Patchwork [4,of,6,cpychecker] parsers: drop spurious check of readlen value

login
register
mail settings
Submitter Augie Fackler
Date Aug. 18, 2015, 9:54 p.m.
Message ID <2c553a1aae96d6660023.1439934854@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/10237/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 18, 2015, 9:54 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1439930366 14400
#      Tue Aug 18 16:39:26 2015 -0400
# Node ID 2c553a1aae96d666002313c6c04acda080eaeff4
# Parent  ec2dee7d4778fc4bc46dff6a74e5af26a99cadb5
parsers: drop spurious check of readlen value

We're about to check if len < 40 after assigning readlen to len, which
means that if len < 40 we'll still abort, but I'm about to add a
sensible exception to that failure, so let's just discard this useless
check.

Patch

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -478,9 +478,6 @@  static PyObject *parse_dirstate(PyObject
 			      &str, &readlen))
 		goto quit;
 
-	if (readlen < 0)
-		goto quit;
-
 	len = readlen;
 
 	/* read parents */