Patchwork [3,of,5] revsets: use itervalues() where only values are needed

login
register
mail settings
Submitter via Mercurial-devel
Date June 24, 2016, 10:10 p.m.
Message ID <4fc03f313a06f6f1ba96.1466806215@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/15609/
State Accepted
Headers show

Comments

via Mercurial-devel - June 24, 2016, 10:10 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1466712490 25200
#      Thu Jun 23 13:08:10 2016 -0700
# Node ID 4fc03f313a06f6f1ba9638d2692351de064e8482
# Parent  452eef4be6b5acbde6b0fd988f6aab27a1c144d1
revsets: use itervalues() where only values are needed

I don't think there will be a noticeable speedup, but it removes an
unused variable.

Patch

diff -r 452eef4be6b5 -r 4fc03f313a06 mercurial/revset.py
--- a/mercurial/revset.py	Thu Jun 23 13:08:08 2016 -0700
+++ b/mercurial/revset.py	Thu Jun 23 13:08:10 2016 -0700
@@ -1143,7 +1143,7 @@ 
     getargs(x, 0, 0, _("head takes no arguments"))
     hs = set()
     cl = repo.changelog
-    for b, ls in repo.branchmap().iteritems():
+    for ls in repo.branchmap().itervalues():
         hs.update(cl.rev(h) for h in ls)
     # XXX We should combine with subset first: 'subset & baseset(...)'. This is
     # necessary to ensure we preserve the order in subset.