Patchwork D3498: revlog: use literal -1 instead of variable that always has that value

login
register
mail settings
Submitter phabricator
Date May 8, 2018, 6:07 p.m.
Message ID <differential-rev-PHID-DREV-zqbrsbk5yzkz3zgd462r-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31383/
State Superseded
Headers show

Comments

phabricator - May 8, 2018, 6:07 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We were setting "ntrev" to "rev", but "rev" was always -1 at the end
  of the loop, so it's clearer to use a literal -1.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3498

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -1243,7 +1243,7 @@ 
 			if (nt_insert(self, n, rev) == -1)
 				return -1;
 		}
-		self->ntrev = rev;
+		self->ntrev = -1;
 	}
 	return 0;
 }