perf: use `setup` function in `perfdirstate`
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.
--- a/contrib/perf.py Tue Oct 08 01:46:57 2019 -0400
+++ b/contrib/perf.py Tue Oct 08 01:57:10 2019 -0400
@@ -1112,11 +1112,13 @@
timer, fm = gettimer(ui, opts)
b"a" in repo.dirstate
+ def setup():
+ repo.dirstate.invalidate()
+
def d():
- repo.dirstate.invalidate()
b"a" in repo.dirstate
- timer(d)
+ timer(d, setup=setup)
fm.end()