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

Simon Heimberg simohe at besonet.ch
Sat Aug 15 17:06:04 CDT 2009


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

diff -r d996b26cc3c2 -r cf5cd700f7d9 mercurial/util.py
--- a/mercurial/util.py	Fre Aug 07 15:40:51 2009 +0200
+++ b/mercurial/util.py	Mit Jul 29 14:21:18 2009 +0200
@@ -663,8 +663,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