# HG changeset patch # User Pierre-Yves David # Date 1534412633 -7200 # Node ID 5fade2cb9e003d5f8e8c377cc409bc44a42d989e # Parent 2b885ca5afcca2662a216a6aea4d4a6c60ea6207 next: use set for membership testing There are no reason to use a list here. diff -r 2b885ca5afcc -r 5fade2cb9e00 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: