changeset 26042:2a3010ba6f52

reachableroots: give anonymous name to short-lived "numheads" variable I'll reuse it for the length of the roots list.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 15 Aug 2015 18:29:58 +0900
parents 8da628be211b
children f2f0a3ab6e41
files mercurial/parsers.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/parsers.c	Sat Aug 15 18:03:47 2015 +0900
+++ b/mercurial/parsers.c	Sat Aug 15 18:29:58 2015 +0900
@@ -1114,7 +1114,6 @@
 	int includepath = 0;
 	/* heads is a list */
 	PyObject *heads = NULL;
-	Py_ssize_t numheads;
 	/* roots is a set */
 	PyObject *roots = NULL;
 	PyObject *reachable = NULL;
@@ -1124,6 +1123,7 @@
 	long revnum;
 	Py_ssize_t k;
 	Py_ssize_t i;
+	Py_ssize_t l;
 	int r;
 	int minidx;
 	int parents[2];
@@ -1164,8 +1164,8 @@
 	}
 
 	/* Populate tovisit with all the heads */
-	numheads = PyList_GET_SIZE(heads);
-	for (i = 0; i < numheads; i++) {
+	l = PyList_GET_SIZE(heads);
+	for (i = 0; i < l; i++) {
 		revnum = PyInt_AsLong(PyList_GET_ITEM(heads, i));
 		if (revnum == -1 && PyErr_Occurred())
 			goto bail;