mercurial/dagutil.py
changeset 24306 6ddc86eedc3b
parent 23216 4e5ac4a3a29b
child 25942 015ded095933
--- a/mercurial/dagutil.py	Fri Mar 13 14:20:13 2015 -0400
+++ b/mercurial/dagutil.py	Fri Mar 13 17:00:06 2015 -0400
@@ -88,7 +88,10 @@
     '''generic implementations for DAGs'''
 
     def ancestorset(self, starts, stops=None):
-        stops = stops and set(stops) or set()
+        if stops:
+            stops = set(stops)
+        else:
+            stops = set()
         seen = set()
         pending = list(starts)
         while pending:
@@ -179,7 +182,10 @@
     def ancestorset(self, starts, stops=None):
         rlog = self._revlog
         idx = rlog.index
-        stops = stops and set(stops) or set()
+        if stops:
+            stops = set(stops)
+        else:
+            stops = set()
         seen = set()
         pending = list(starts)
         while pending: