Patchwork D4044: absorb: use set literal to avoid intermediate list

login
register
mail settings
Submitter phabricator
Date Aug. 6, 2018, 3:54 p.m.
Message ID <05088a7ee29d8e509d116291b4021fe4@localhost.localdomain>
Download mbox | patch
Permalink /patch/33336/
State Not Applicable
Headers show

Comments

phabricator - Aug. 6, 2018, 3:54 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdc4750b2a04e: absorb: use set literal to avoid intermediate list (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4044?vs=9761&id=9988

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

AFFECTED FILES
  hgext/absorb.py

CHANGE DETAILS




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

Patch

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))