changeset 3947:5fade2cb9e00 stable

next: use set for membership testing There are no reason to use a list here.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 16 Aug 2018 11:43:53 +0200
parents 2b885ca5afcc
children 836402690a63
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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: