changeset 24662:b5cd8c2f6e65

changelog: inline revlog.__contains__ in case it is used in hot loop Currently __contains__ is called only by "rev()" revset, but "x in cl" is a function that is likely to be used in hot loop. revlog.__contains__ is simple enough to duplicate to changelog, so just inline it.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 04 Apr 2015 22:30:59 +0900
parents 8cf70c97a6e1
children 7d01371e6358
files mercurial/changelog.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changelog.py	Wed Apr 08 02:56:19 2015 +0900
+++ b/mercurial/changelog.py	Sat Apr 04 22:30:59 2015 +0900
@@ -145,7 +145,7 @@
 
     def __contains__(self, rev):
         """filtered version of revlog.__contains__"""
-        return (revlog.revlog.__contains__(self, rev)
+        return (0 <= rev < len(self)
                 and rev not in self.filteredrevs)
 
     def __iter__(self):