D5188: narrow: replace filtering in list comprehension by set operations
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5d8f291405e5: narrow: replace filtering in list comprehension by set operations (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5188?vs=12332=12333 REVISION DETAIL https://phab.mercurial-scm.org/D5188 AFFECTED FILES hgext/narrow/narrowcommands.py CHANGE DETAILS diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py +++ b/hgext/narrow/narrowcommands.py @@ -400,10 +400,10 @@ # filter the user passed additions and deletions into actual additions and # deletions of excludes and includes -addedincludes = set([i for i in addedincludes if i not in oldincludes]) -removedincludes = set([i for i in removedincludes if i in oldincludes]) -addedexcludes = set([i for i in addedexcludes if i not in oldexcludes]) -removedexcludes = set([i for i in removedexcludes if i in oldexcludes]) +addedincludes -= oldincludes +removedincludes &= oldincludes +addedexcludes -= oldexcludes +removedexcludes &= oldexcludes widening = addedincludes or removedexcludes narrowing = removedincludes or addedexcludes To: martinvonz, durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5188: narrow: replace filtering in list comprehension by set operations
martinvonz created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I didn't think of this while reviewing the patch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5188 AFFECTED FILES hgext/narrow/narrowcommands.py CHANGE DETAILS diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py +++ b/hgext/narrow/narrowcommands.py @@ -400,10 +400,10 @@ # filter the user passed additions and deletions into actual additions and # deletions of excludes and includes -addedincludes = set([i for i in addedincludes if i not in oldincludes]) -removedincludes = set([i for i in removedincludes if i in oldincludes]) -addedexcludes = set([i for i in addedexcludes if i not in oldexcludes]) -removedexcludes = set([i for i in removedexcludes if i in oldexcludes]) +addedincludes -= oldincludes +removedincludes &= oldincludes +addedexcludes -= oldexcludes +removedexcludes &= oldexcludes widening = addedincludes or removedexcludes narrowing = removedincludes or addedexcludes To: martinvonz, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel