changeset 7363:9d28ff207030

revlog: speed up parents()
author Matt Mackall <mpm@selenic.com>
date Wed, 12 Nov 2008 15:58:46 -0600
parents 6db4a2ccef3a
children ad7f736f3214
files mercurial/revlog.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Nov 12 15:32:16 2008 -0600
+++ b/mercurial/revlog.py	Wed Nov 12 15:58:46 2008 -0600
@@ -503,8 +503,9 @@
     def linkrev(self, rev):
         return self.index[rev][4]
     def parents(self, node):
-        d = self.index[self.rev(node)][5:7]
-        return (self.node(d[0]), self.node(d[1]))
+        i = self.index
+        d = i[self.rev(node)]
+        return i[d[5]][7], i[d[6]][7] # map revisions to nodes inline
     def parentrevs(self, rev):
         return self.index[rev][5:7]
     def start(self, rev):