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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue May 8 18:07:29 UTC 2018


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

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



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


More information about the Mercurial-devel mailing list