[PATCH] Remove redundant 'n' variable in parsers.parse_index2() (issue2935)

Andrey Somov py4fun at gmail.com
Mon Aug 1 08:17:02 CDT 2011


# HG changeset patch
# User py4fun
# Date 1312143133 -7200
# Node ID 6c16361da725afc288de41ea47fc06a6a121c7c2
# Parent  cc2c22511707b13d045f17bb34e865d2393c53cf
Remove redundant 'n' variable in parsers.parse_index2() (issue2935)

diff -r cc2c22511707 -r 6c16361da725 mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py	Fri Jul 29 17:27:38 2011 -0500
+++ b/mercurial/pure/parsers.py	Sun Jul 31 22:12:13 2011 +0200
@@ -36,7 +36,7 @@
     s = struct.calcsize(indexformatng)
     index = []
     cache = None
-    n = off = 0
+    off = 0
 
     l = len(data) - s
     append = index.append
@@ -45,7 +45,6 @@
         while off <= l:
             e = _unpack(indexformatng, data[off:off + s])
             append(e)
-            n += 1
             if e[1] < 0:
                 break
             off += e[1] + s
@@ -53,7 +52,6 @@
         while off <= l:
             e = _unpack(indexformatng, data[off:off + s])
             append(e)
-            n += 1
             off += s
 
     if off != len(data):


More information about the Mercurial-devel mailing list