mercurial/cext/revlog.c
changeset 38867 4c0fd3f0a15d
parent 38866 aa33988ad8ab
child 38868 0db50770f388
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);