[PATCH] parsers: narrow scope of a variable to be less confusing

Bryan O'Sullivan bos at serpentine.com
Sun Dec 13 05:01:19 UTC 2015


# HG changeset patch
# User Bryan O'Sullivan <bos at serpentine.com>
# Date 1449982621 28800
#      Sat Dec 12 20:57:01 2015 -0800
# Node ID f9d7c5483dbb148a0895867a601f8d0920379be2
# Parent  7d1b0fa50a8f1f856104aa7afd60f54b736ae170
parsers: narrow scope of a variable to be less confusing

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1994,19 +1994,19 @@ static PyObject *find_deepest(indexObjec
 
 		for (i = 0; i < 2; i++) {
 			int p = parents[i];
-			long nsp, sp;
+			long sp;
 			int dp;
 
 			if (p == -1)
 				continue;
 
 			dp = depth[p];
-			nsp = sp = seen[p];
+			sp = seen[p];
 			if (dp <= dv) {
 				depth[p] = dv + 1;
 				if (sp != sv) {
 					interesting[sv] += 1;
-					nsp = seen[p] = sv;
+					seen[p] = sv;
 					if (sp) {
 						interesting[sp] -= 1;
 						if (interesting[sp] == 0)
@@ -2015,7 +2015,7 @@ static PyObject *find_deepest(indexObjec
 				}
 			}
 			else if (dv == dp - 1) {
-				nsp = sp | sv;
+				long nsp = sp | sv;
 				if (nsp == sp)
 					continue;
 				seen[p] = nsp;


More information about the Mercurial-devel mailing list