Skip to content
Snippets Groups Projects
Commit 43974cd4 authored by Boris Feld's avatar Boris Feld
Browse files

revlog: introduce a constant for nullrev in `revlog.c`

The value is important enough to be explicitly tracked.
parent d097dd0a
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,7 @@
static PyObject *nullentry = NULL;
static const char nullid[20] = {0};
static const Py_ssize_t nullrev = -1;
static Py_ssize_t inline_scan(indexObject *self, const char **offsets);
......@@ -308,7 +309,7 @@
Py_ssize_t length = index_length(self);
PyObject *entry;
if (pos == -1) {
if (pos == nullrev) {
Py_INCREF(nullentry);
return nullentry;
}
......@@ -378,7 +379,7 @@
Py_ssize_t length = index_length(self);
const char *data;
if (pos == -1)
if (pos == nullrev)
return nullid;
if (pos >= length)
......@@ -701,7 +702,7 @@
}
/* Add its parents to the list of nodes to visit */
if (revnum == -1)
if (revnum == nullrev)
continue;
r = index_get_parents(self, revnum, parents, (int)len - 1);
if (r < 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment