# HG changeset patch # User Pierre-Yves David # Date 1570515375 14400 # Node ID e337d824737580e8da11c1244dcd70dd84834f1d # Parent 56494a2bfe2f1db8f3fdb564709952f501b595d5 perf: use `setup` function in `perfdirstatefoldmap` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function. diff -r 56494a2bfe2f -r e337d8247375 contrib/perf.py --- a/contrib/perf.py Tue Oct 08 01:48:10 2019 -0400 +++ b/contrib/perf.py Tue Oct 08 02:16:15 2019 -0400 @@ -1149,13 +1149,15 @@ opts = _byteskwargs(opts) timer, fm = gettimer(ui, opts) dirstate = repo.dirstate - b'a' in dirstate + dirstate._map.filefoldmap.get(b'a') + + def setup(): + del dirstate._map.filefoldmap def d(): dirstate._map.filefoldmap.get(b'a') - del dirstate._map.filefoldmap - - timer(d) + + timer(d, setup=setup) fm.end()