mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
dirstate: test normalize is truthy instead of using a no-op lambda
hg perfstatus -u on a working directory with 170,000 files, without this change: ! wall 1.869404 comb 1.850000 user 1.170000 sys 0.680000 (best of 6) With this change: ! wall 1.839561 comb 1.830000 user 1.120000 sys 0.710000 (best of 6)
This commit is contained in:
parent
e8ece086e3
commit
40de7ddbeb
@ -605,7 +605,7 @@ class dirstate(object):
|
|||||||
normalize = self._normalize
|
normalize = self._normalize
|
||||||
skipstep3 = False
|
skipstep3 = False
|
||||||
else:
|
else:
|
||||||
normalize = lambda x, y, z: x
|
normalize = None
|
||||||
|
|
||||||
files = sorted(match.files())
|
files = sorted(match.files())
|
||||||
subrepos.sort()
|
subrepos.sort()
|
||||||
@ -626,7 +626,10 @@ class dirstate(object):
|
|||||||
|
|
||||||
# step 1: find all explicit files
|
# step 1: find all explicit files
|
||||||
for ff in files:
|
for ff in files:
|
||||||
nf = normalize(normpath(ff), False, True)
|
if normalize:
|
||||||
|
nf = normalize(normpath(ff), False, True)
|
||||||
|
else:
|
||||||
|
nf = normpath(ff)
|
||||||
if nf in results:
|
if nf in results:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -676,7 +679,10 @@ class dirstate(object):
|
|||||||
continue
|
continue
|
||||||
raise
|
raise
|
||||||
for f, kind, st in entries:
|
for f, kind, st in entries:
|
||||||
nf = normalize(nd and (nd + "/" + f) or f, True, True)
|
if normalize:
|
||||||
|
nf = normalize(nd and (nd + "/" + f) or f, True, True)
|
||||||
|
else:
|
||||||
|
nf = nd and (nd + "/" + f) or f
|
||||||
if nf not in results:
|
if nf not in results:
|
||||||
if kind == dirkind:
|
if kind == dirkind:
|
||||||
if not ignore(nf):
|
if not ignore(nf):
|
||||||
|
Loading…
Reference in New Issue
Block a user