Mercurial > hg
comparison mercurial/cext/revlog.c @ 38867:4c0fd3f0a15d
index: drop support for nullid at position len(index) in index_node
I think no callers exist since at least a3dacabd476b (index: don't
allow index[len(index)] to mean nullid, 2018-07-20).
Differential Revision: https://phab.mercurial-scm.org/D4105
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 04 Aug 2018 22:48:25 -0700 |
parents | aa33988ad8ab |
children | 0db50770f388 |
comparison
equal
deleted
inserted
replaced
38866:aa33988ad8ab | 38867:4c0fd3f0a15d |
---|---|
226 static const char *index_node(indexObject *self, Py_ssize_t pos) | 226 static const char *index_node(indexObject *self, Py_ssize_t pos) |
227 { | 227 { |
228 Py_ssize_t length = index_length(self) + 1; | 228 Py_ssize_t length = index_length(self) + 1; |
229 const char *data; | 229 const char *data; |
230 | 230 |
231 if (pos == length - 1 || pos == -1) | 231 if (pos == -1) |
232 return nullid; | 232 return nullid; |
233 | 233 |
234 if (pos >= length) | 234 if (pos >= length - 1) |
235 return NULL; | 235 return NULL; |
236 | 236 |
237 if (pos >= self->length - 1) { | 237 if (pos >= self->length - 1) { |
238 PyObject *tuple, *str; | 238 PyObject *tuple, *str; |
239 tuple = PyList_GET_ITEM(self->added, pos - self->length + 1); | 239 tuple = PyList_GET_ITEM(self->added, pos - self->length + 1); |