revset: gratuitous code move in '_children'
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 11 Jun 2015 14:27:52 -0700
changeset 25550 3e9049876ace
parent 25549 f93ff3ab8d14
child 25551 c1d163ce7394
revset: gratuitous code move in '_children' As 'cs' is empty as the time of the conditional, we can just return an empty 'baseset' and create the variable later.
mercurial/revset.py
--- a/mercurial/revset.py	Thu Jun 11 14:26:44 2015 -0700
+++ b/mercurial/revset.py	Thu Jun 11 14:27:52 2015 -0700
@@ -614,9 +614,9 @@
     return subset.filter(matches)
 
 def _children(repo, narrow, parentset):
+    if not parentset:
+        return baseset()
     cs = set()
-    if not parentset:
-        return baseset(cs)
     pr = repo.changelog.parentrevs
     # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset
     # (and if it is not, it should.)