rebase, revlog: use set(x) instead of set(x.keys())
authorMartin Geisler <mg@lazybytes.net>
Sat, 25 Apr 2009 22:25:49 +0200
changeset 8163 62d7287fe6b0
parent 8162 6f14253416bd
child 8164 aaec1f65926e
rebase, revlog: use set(x) instead of set(x.keys()) The latter is both unnecessary and slower.
hgext/rebase.py
mercurial/revlog.py
--- a/hgext/rebase.py	Wed Apr 15 10:33:58 2009 -0500
+++ b/hgext/rebase.py	Sat Apr 25 22:25:49 2009 +0200
@@ -128,8 +128,7 @@
 
         if not keepf:
             # Remove no more useful revisions
-            if (set(repo.changelog.descendants(min(state)))
-                                                    - set(state.keys())):
+            if set(repo.changelog.descendants(min(state))) - set(state):
                 ui.warn(_("warning: new changesets detected on source branch, "
                                                         "not stripping\n"))
             else:
--- a/mercurial/revlog.py	Wed Apr 15 10:33:58 2009 -0500
+++ b/mercurial/revlog.py	Sat Apr 25 22:25:49 2009 +0200
@@ -678,7 +678,7 @@
             # find from roots.
             heads = dict.fromkeys(heads, 0)
             # Start at the top and keep marking parents until we're done.
-            nodestotag = set(heads.keys())
+            nodestotag = set(heads)
             # Remember where the top was so we can use it as a limit later.
             highestrev = max([self.rev(n) for n in nodestotag])
             while nodestotag: