changeset 26636:ff6baf32b3ba

revset: eliminate temporary reference to subset in limit() and last()
author Yuya Nishihara <yuya@tcha.org>
date Mon, 12 Oct 2015 17:14:47 +0900
parents 79d86ab65c9d
children 179764469754
files mercurial/revset.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Oct 14 02:49:17 2015 +0900
+++ b/mercurial/revset.py	Mon Oct 12 17:14:47 2015 +0900
@@ -1297,7 +1297,6 @@
     except (TypeError, ValueError):
         # i18n: "limit" is a keyword
         raise error.ParseError(_("limit expects a number"))
-    ss = subset
     os = getset(repo, fullreposet(repo), l[0])
     result = []
     it = iter(os)
@@ -1305,7 +1304,7 @@
         y = next(it, None)
         if y is None:
             break
-        elif y in ss:
+        elif y in subset:
             result.append(y)
     return baseset(result)
 
@@ -1323,7 +1322,6 @@
     except (TypeError, ValueError):
         # i18n: "last" is a keyword
         raise error.ParseError(_("last expects a number"))
-    ss = subset
     os = getset(repo, fullreposet(repo), l[0])
     os.reverse()
     result = []
@@ -1332,7 +1330,7 @@
         y = next(it, None)
         if y is None:
             break
-        elif y in ss:
+        elif y in subset:
             result.append(y)
     return baseset(result)