##// END OF EJS Templates
parsers: move index_get_parents's declaration higher...
Laurent Charignon -
r25311:d2e88f96 default
parent child Browse files
Show More
@@ -741,6 +741,22 b' static const char *index_deref(indexObje'
741 return PyString_AS_STRING(self->data) + pos * v1_hdrsize;
741 return PyString_AS_STRING(self->data) + pos * v1_hdrsize;
742 }
742 }
743
743
744 static inline void index_get_parents(indexObject *self, Py_ssize_t rev,
745 int *ps)
746 {
747 if (rev >= self->length - 1) {
748 PyObject *tuple = PyList_GET_ITEM(self->added,
749 rev - self->length + 1);
750 ps[0] = (int)PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 5));
751 ps[1] = (int)PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 6));
752 } else {
753 const char *data = index_deref(self, rev);
754 ps[0] = getbe32(data + 24);
755 ps[1] = getbe32(data + 28);
756 }
757 }
758
759
744 /*
760 /*
745 * RevlogNG format (all in big endian, data may be inlined):
761 * RevlogNG format (all in big endian, data may be inlined):
746 * 6 bytes: offset
762 * 6 bytes: offset
@@ -1177,21 +1193,6 b' release_none:'
1177 return ret;
1193 return ret;
1178 }
1194 }
1179
1195
1180 static inline void index_get_parents(indexObject *self, Py_ssize_t rev,
1181 int *ps)
1182 {
1183 if (rev >= self->length - 1) {
1184 PyObject *tuple = PyList_GET_ITEM(self->added,
1185 rev - self->length + 1);
1186 ps[0] = (int)PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 5));
1187 ps[1] = (int)PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 6));
1188 } else {
1189 const char *data = index_deref(self, rev);
1190 ps[0] = getbe32(data + 24);
1191 ps[1] = getbe32(data + 28);
1192 }
1193 }
1194
1195 static PyObject *index_headrevs(indexObject *self, PyObject *args)
1196 static PyObject *index_headrevs(indexObject *self, PyObject *args)
1196 {
1197 {
1197 Py_ssize_t i, j, len;
1198 Py_ssize_t i, j, len;
General Comments 0
You need to be logged in to leave comments. Login now