Mercurial > public > mercurial-scm > hg
diff mercurial/windows.py @ 16076:e7701459fb42
windows: use 'str.replace()' instead of combination of split() and join()
'str.replace()' is twice (or more) as fast as combination of split()
and join().
combination of split() and join() in current 'util.pconvert()'
implementation comes only from historical reason when win32mbcs
extension was introduced.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 05 Feb 2012 22:58:31 +0900 |
parents | 7b7f03502b5a |
children | e34106fa0dc3 98823bd0d697 |
line wrap: on
line diff
--- a/mercurial/windows.py Mon Feb 06 12:16:29 2012 +0900 +++ b/mercurial/windows.py Sun Feb 05 22:58:31 2012 +0900 @@ -123,7 +123,7 @@ msvcrt.setmode(fno(), os.O_BINARY) def pconvert(path): - return '/'.join(path.split(os.sep)) + return path.replace(os.sep, '/') def localpath(path): return path.replace('/', '\\')