[PATCH 3 of 9 cah] parsers: remove unnecessary gca variable in index_commonancestorsheads

Mads Kiilerich mads at kiilerich.com
Thu Apr 17 13:07:55 CDT 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1397757488 -7200
#      Thu Apr 17 19:58:08 2014 +0200
# Node ID 628c16489d1cec98f0f43a784375ff4fefb0dc52
# Parent  4eb6553789e1da54f5dd816774dc1ec6bce68092
parsers: remove unnecessary gca variable in index_commonancestorsheads

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -1549,7 +1549,7 @@ bail:
  */
 static PyObject *index_commonancestorsheads(indexObject *self, PyObject *args)
 {
-	PyObject *ret = NULL, *gca = NULL;
+	PyObject *ret = NULL;
 	Py_ssize_t argcount, i, len;
 	bitmask repeat = 0;
 	int revcount = 0;
@@ -1620,22 +1620,16 @@ static PyObject *index_commonancestorshe
 		goto done;
 	}
 
-	gca = find_gca_candidates(self, revs, revcount);
-	if (gca == NULL)
+	ret = find_gca_candidates(self, revs, revcount);
+	if (ret == NULL)
 		goto bail;
 
-	ret = gca;
-	Py_INCREF(gca);
-
 done:
 	free(revs);
-	Py_XDECREF(gca);
-
 	return ret;
 
 bail:
 	free(revs);
-	Py_XDECREF(gca);
 	Py_XDECREF(ret);
 	return NULL;
 }


More information about the Mercurial-devel mailing list