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

login
register
mail settings
Submitter Mads Kiilerich
Date April 17, 2014, 6:07 p.m.
Message ID <628c16489d1cec98f0f4.1397758075@localhost.localdomain>
Download mbox | patch
Permalink /patch/4398/
State Accepted
Commit 628c16489d1cec98f0f43a784375ff4fefb0dc52
Headers show

Comments

Mads Kiilerich - April 17, 2014, 6:07 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@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

Patch

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;
 }