From patchwork Thu Apr 17 18:07:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3, of, 9, cah] parsers: remove unnecessary gca variable in index_commonancestorsheads From: Mads Kiilerich X-Patchwork-Id: 4398 Message-Id: <628c16489d1cec98f0f4.1397758075@localhost.localdomain> To: mercurial-devel@selenic.com Date: Thu, 17 Apr 2014 20:07:55 +0200 # HG changeset patch # User Mads Kiilerich # 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; }