util: quicker fspath, do not lower names when the length is different
authorSimon Heimberg <simohe@besonet.ch>
Wed, 29 Jul 2009 14:21:18 +0200
changeset 9397 5b117c90f036
parent 9396 5cd14e1e8385
child 9398 3fb8c6dbeeec
util: quicker fspath, do not lower names when the length is different
mercurial/util.py
--- a/mercurial/util.py	Fri Aug 07 15:40:51 2009 +0200
+++ b/mercurial/util.py	Wed Jul 29 14:21:18 2009 +0200
@@ -661,8 +661,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: