changeset 40438:5d8f291405e5

narrow: replace filtering in list comprehension by set operations I didn't think of this while reviewing the patch. Differential Revision: https://phab.mercurial-scm.org/D5188
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 23 Oct 2018 14:04:17 -0700
parents a0e7fa019290
children 25f1c7bd649d
files hgext/narrow/narrowcommands.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/narrow/narrowcommands.py	Tue Oct 23 19:20:22 2018 +0200
+++ b/hgext/narrow/narrowcommands.py	Tue Oct 23 14:04:17 2018 -0700
@@ -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