# HG changeset patch # User David M. Carr # Date 1351470762 14400 # Node ID b3881fda3ce9c106f1affdf1c683485640aeec83 # Parent af4d66e2bc6e1b7f2d87f761625bcc925ad80c63 listkeys: simplify ref stripping expression Eliminate a find that would always return 0, based on an example in git_handler update_hg_bookmarks. diff --git a/hggit/gitrepo.py b/hggit/gitrepo.py --- a/hggit/gitrepo.py +++ b/hggit/gitrepo.py @@ -62,7 +62,7 @@ newcommits = [bin(c) for c in commits] b = overlayrepo(handler, newcommits, refs) stripped_refs = dict([ - (ref[ref.find('refs/heads/')+11:], b.node(refs[ref])) + (ref[11:], b.node(refs[ref])) for ref in refs.keys() if ref.startswith('refs/heads/')]) return stripped_refs