[PATCH 3 of 6] parsers.c: parse_dirstate: return NULL directly when no Python Objects are used

Nicolas Dumazet nicdumz at gmail.com
Thu Aug 27 08:09:12 CDT 2009


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1251369814 -7200
# Node ID 84617922fc1b579685869172349c0c679be4b7fc
# Parent  a235d3e45140f5532b3e7886f7beada51675bde4
parsers.c: parse_dirstate: return NULL directly when no Python Objects are used

During the initialization, no Python objects are being referenced.
In this context the "goto quit" is equivalent to the clearer "return NULL"

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -173,15 +173,15 @@
 				  &PyDict_Type, &dmap,
 				  &PyDict_Type, &cmap,
 				  &str, &len))
-		goto quit;
+		return NULL;
 
 	/* read parents */
 	if (len < 40)
-		goto quit;
+		return NULL;
 
 	parents = Py_BuildValue("s#s#", str, 20, str + 20, 20);
 	if (!parents)
-		goto quit;
+		return NULL;
 
 	/* read filenames */
 	cur = str + 40;


More information about the Mercurial-devel mailing list