changeset 8479:3e16c0fc2241

repair: bulk update sets Use a single set.update and set.difference_update call instead of many set.add and set.discard calls.
author Martin Geisler <mg@lazybytes.net>
date Sun, 17 May 2009 16:55:51 +0200
parents d728f126c1b7
children 0e91bcaaa92c
files mercurial/repair.py
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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]