changeset 25130:a94ef7f517e0

revset: use fastasc/fastdesc switch consistently in addset.__iter__
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 May 2015 14:05:02 +0900
parents 40a2cf1c765b
children adfe4d9680bf
files mercurial/revset.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Mon Mar 30 20:56:37 2015 +0900
+++ b/mercurial/revset.py	Sat May 16 14:05:02 2015 +0900
@@ -3047,15 +3047,13 @@
         # try to use our own fast iterator if it exists
         self._trysetasclist()
         if self._ascending:
-            it = self.fastasc
+            attr = 'fastasc'
         else:
-            it = self.fastdesc
+            attr = 'fastdesc'
+        it = getattr(self, attr)
         if it is not None:
             return it()
         # maybe half of the component supports fast
-        attr = 'fastdesc'
-        if self._ascending:
-            attr = 'fastasc'
         # get iterator for _r1
         iter1 = getattr(self._r1, attr)
         if iter1 is None: