readmarkers: hoist subtraction out of loop comparison
authorMatt Mackall <mpm@selenic.com>
Sun, 11 Jan 2015 14:44:57 -0600
changeset 23799 ffca0a14b566
parent 23798 86d2a0c41f44
child 23800 83f361a21d31
readmarkers: hoist subtraction out of loop comparison
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Sun Jan 11 14:43:31 2015 -0600
+++ b/mercurial/obsolete.py	Sun Jan 11 14:44:57 2015 -0600
@@ -287,9 +287,9 @@
 
 def _fm1readmarkers(data, off=0):
     # Loop on markers
-    l = len(data)
+    stop = len(data) - _fm1fsize
     ufixed = util.unpacker(_fm1fixed)
-    while off + _fm1fsize <= l:
+    while off <= stop:
         # read fixed part
         o1 = off + _fm1fsize
         fixeddata = ufixed(data[off:o1])