verify: use set instead of dict
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 17 May 2009 04:14:15 +0200
changeset 8466 afb3e504b558
parent 8465 23429ebd3f9d
child 8467 9890151a7f30
verify: use set instead of dict
mercurial/verify.py
--- a/mercurial/verify.py	Sun May 17 03:53:13 2009 +0200
+++ b/mercurial/verify.py	Sun May 17 04:14:15 2009 +0200
@@ -21,7 +21,7 @@
     filelinkrevs = {}
     filenodes = {}
     revisions = 0
-    badrevs = {}
+    badrevs = set()
     errors = [0]
     warnings = [0]
     ui = repo.ui
@@ -33,7 +33,7 @@
 
     def err(linkrev, msg, filename=None):
         if linkrev != None:
-            badrevs[linkrev] = True
+            badrevs.add(linkrev)
         else:
             linkrev = '?'
         msg = "%s: %s" % (linkrev, msg)
@@ -166,12 +166,12 @@
 
     ui.status(_("checking files\n"))
 
-    storefiles = {}
+    storefiles = set()
     for f, f2, size in repo.store.datafiles():
         if not f:
             err(None, _("cannot decode filename '%s'") % f2)
         elif size > 0:
-            storefiles[f] = True
+            storefiles.add(f)
 
     files = sorted(set(filenodes) | set(filelinkrevs))
     for f in files:
@@ -194,7 +194,7 @@
 
         for ff in fl.files():
             try:
-                del storefiles[ff]
+                storefiles.remove(ff)
             except KeyError:
                 err(lr, _("missing revlog!"), ff)