diff mercurial/hbisect.py @ 8152:08e1baf924ca

replace set-like dictionaries with real sets Many of the dictionaries created by dict.fromkeys were emulating sets. These can now be replaced with real sets.
author Martin Geisler <mg@lazybytes.net>
date Wed, 22 Apr 2009 00:57:28 +0200
parents 496ae1ea4698
children 46293a0c7e9f
line wrap: on
line diff
--- a/mercurial/hbisect.py	Wed Apr 22 00:56:06 2009 +0200
+++ b/mercurial/hbisect.py	Wed Apr 22 00:57:28 2009 +0200
@@ -24,7 +24,7 @@
     """
 
     clparents = changelog.parentrevs
-    skip = dict.fromkeys([changelog.rev(n) for n in state['skip']])
+    skip = set([changelog.rev(n) for n in state['skip']])
 
     def buildancestors(bad, good):
         # only the earliest bad revision matters
@@ -109,7 +109,7 @@
 
         for c in children.get(rev, []):
             if ancestors[c]:
-                ancestors[c] = dict.fromkeys(ancestors[c] + a).keys()
+                ancestors[c] = list(set(ancestors[c] + a))
             else:
                 ancestors[c] = a + [c]