repair: bulk update sets
Use a single set.update and set.difference_update call instead of many
set.add and set.discard calls.
--- a/mercurial/repair.py Sun May 17 16:20:27 2009 +0200
+++ b/mercurial/repair.py Sun May 17 16:55:51 2009 +0200
@@ -26,10 +26,7 @@
files = set()
for x in xrange(striprev, len(repo)):
- for name in repo[x].files():
- if name in files:
- continue
- files.add(name)
+ files.update(repo[x].files())
return sorted(files)
@@ -100,8 +97,7 @@
if parents[0] < striprev and parents[1] < striprev:
savebases.append(cl.node(r))
- for p in parents:
- saveheads.discard(p)
+ saveheads.difference_update(parents)
saveheads.add(r)
saveheads = [cl.node(r) for r in saveheads]