D4105: index: drop support for nullid at position len(index) in index_node

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sun Aug 5 09:04:44 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4c0fd3f0a15d: index: drop support for nullid at position len(index) in index_node (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4105?vs=9908&id=9929

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

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
@@ -228,10 +228,10 @@
 	Py_ssize_t length = index_length(self) + 1;
 	const char *data;
 
-	if (pos == length - 1 || pos == -1)
+	if (pos == -1)
 		return nullid;
 
-	if (pos >= length)
+	if (pos >= length - 1)
 		return NULL;
 
 	if (pos >= self->length - 1) {



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


More information about the Mercurial-devel mailing list