next: use set for membership testing stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 16 Aug 2018 11:43:53 +0200
branchstable
changeset 3947 5fade2cb9e00
parent 3941 2b885ca5afcc
child 3948 836402690a63
next: use set for membership testing There are no reason to use a list here.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Wed Aug 08 20:21:34 2018 +0900
+++ b/hgext3rd/evolve/__init__.py	Thu Aug 16 11:43:53 2018 +0200
@@ -1142,10 +1142,9 @@
 
         children = [ctx for ctx in wparents[0].children() if not ctx.obsolete()]
         topic = _getcurrenttopic(repo)
-        filtered = []
+        filtered = set()
         if topic and not opts.get("no_topic", False):
-            filtered = [ctx for ctx in children if ctx.topic() != topic]
-            # XXX N-square membership on children
+            filtered = set(ctx for ctx in children if ctx.topic() != topic)
             children = [ctx for ctx in children if ctx not in filtered]
         displayer = compat.changesetdisplayer(ui, repo,
                                               {'template': shorttemplate})
@@ -1169,7 +1168,6 @@
             if topic:
                 filtered.extend(repo[c] for c in children
                                 if repo[c].topic() != topic)
-                # XXX N-square membership on children
                 aspchildren = [ctx for ctx in aspchildren if ctx not in filtered]
             if not opts['evolve'] or not aspchildren:
                 if filtered: