##// END OF EJS Templates
revlog: introduce a constant for nullrev in `revlog.c`...
Boris Feld -
r40996:43974cd4 default
parent child Browse files
Show More
@@ -98,6 +98,7 b' static Py_ssize_t index_length(const ind'
98 98
99 99 static PyObject *nullentry = NULL;
100 100 static const char nullid[20] = {0};
101 static const Py_ssize_t nullrev = -1;
101 102
102 103 static Py_ssize_t inline_scan(indexObject *self, const char **offsets);
103 104
@@ -308,7 +309,7 b' static PyObject *index_get(indexObject *'
308 309 Py_ssize_t length = index_length(self);
309 310 PyObject *entry;
310 311
311 if (pos == -1) {
312 if (pos == nullrev) {
312 313 Py_INCREF(nullentry);
313 314 return nullentry;
314 315 }
@@ -378,7 +379,7 b' static const char *index_node(indexObjec'
378 379 Py_ssize_t length = index_length(self);
379 380 const char *data;
380 381
381 if (pos == -1)
382 if (pos == nullrev)
382 383 return nullid;
383 384
384 385 if (pos >= length)
@@ -701,7 +702,7 b' static PyObject *reachableroots2(indexOb'
701 702 }
702 703
703 704 /* Add its parents to the list of nodes to visit */
704 if (revnum == -1)
705 if (revnum == nullrev)
705 706 continue;
706 707 r = index_get_parents(self, revnum, parents, (int)len - 1);
707 708 if (r < 0)
General Comments 0
You need to be logged in to leave comments. Login now