mercurial/cext/revlog.c
changeset 38867 4c0fd3f0a15d
parent 38866 aa33988ad8ab
child 38868 0db50770f388
--- a/mercurial/cext/revlog.c	Sat Aug 04 23:15:03 2018 -0700
+++ b/mercurial/cext/revlog.c	Sat Aug 04 22:48:25 2018 -0700
@@ -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) {