[PATCH 11 of 11] util: quicker fspath, do not lower names when the length is different

Simon Heimberg simohe at besonet.ch
Fri Aug 7 14:43:09 CDT 2009


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1248870078 -7200
# Node ID f4ea9916e8eee7dc1ea493609a5840ea3e946be3
# Parent  f2d55e3789c6b5be6d28e0fea7d2a9f8e7e87e50
util: quicker fspath, do not lower names when the length is different

diff -r f2d55e3789c6 -r f4ea9916e8ee mercurial/util.py
--- a/mercurial/util.py	Fre Aug 07 21:06:36 2009 +0200
+++ b/mercurial/util.py	Mit Jul 29 14:21:18 2009 +0200
@@ -682,8 +682,9 @@
         contents = _fspathcache[dir]
 
         lpart = part.lower()
+        lenp = len(part)
         for n in contents:
-            if n.lower() == lpart:
+            if lenp == len(n) and n.lower() == lpart:
                 result.append(n)
                 break
         else:


More information about the Mercurial-devel mailing list