##// END OF EJS Templates
revset: eliminate temporary reference to subset in limit() and last()
Yuya Nishihara -
r26636:ff6baf32 default
parent child Browse files
Show More
@@ -1297,7 +1297,6 b' def limit(repo, subset, x):'
1297 1297 except (TypeError, ValueError):
1298 1298 # i18n: "limit" is a keyword
1299 1299 raise error.ParseError(_("limit expects a number"))
1300 ss = subset
1301 1300 os = getset(repo, fullreposet(repo), l[0])
1302 1301 result = []
1303 1302 it = iter(os)
@@ -1305,7 +1304,7 b' def limit(repo, subset, x):'
1305 1304 y = next(it, None)
1306 1305 if y is None:
1307 1306 break
1308 elif y in ss:
1307 elif y in subset:
1309 1308 result.append(y)
1310 1309 return baseset(result)
1311 1310
@@ -1323,7 +1322,6 b' def last(repo, subset, x):'
1323 1322 except (TypeError, ValueError):
1324 1323 # i18n: "last" is a keyword
1325 1324 raise error.ParseError(_("last expects a number"))
1326 ss = subset
1327 1325 os = getset(repo, fullreposet(repo), l[0])
1328 1326 os.reverse()
1329 1327 result = []
@@ -1332,7 +1330,7 b' def last(repo, subset, x):'
1332 1330 y = next(it, None)
1333 1331 if y is None:
1334 1332 break
1335 elif y in ss:
1333 elif y in subset:
1336 1334 result.append(y)
1337 1335 return baseset(result)
1338 1336
General Comments 0
You need to be logged in to leave comments. Login now