D4044: absorb: use set literal to avoid intermediate list

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Aug 1 22:47:29 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4044

AFFECTED FILES
  hgext/absorb.py

CHANGE DETAILS

diff --git a/hgext/absorb.py b/hgext/absorb.py
--- a/hgext/absorb.py
+++ b/hgext/absorb.py
@@ -377,7 +377,7 @@
         if not involved and annotated: # a1 == a2 and a is not empty
             # pure insertion, check nearby lines. ignore lines belong
             # to the public (first) changeset (i.e. annotated[i][0] == 1)
-            nearbylinenums = set([a2, max(0, a1 - 1)])
+            nearbylinenums = {a2, max(0, a1 - 1)}
             involved = [annotated[i]
                         for i in nearbylinenums if annotated[i][0] != 1]
         involvedrevs = list(set(r for r, l in involved))



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list