Show More
@@ -1251,7 +1251,7 b' static PyObject *index_getitem(indexObje' | |||||
1251 | /* |
|
1251 | /* | |
1252 | * Fully populate the radix tree. |
|
1252 | * Fully populate the radix tree. | |
1253 | */ |
|
1253 | */ | |
1254 |
static int |
|
1254 | static int index_populate_nt(indexObject *self) { | |
1255 | int rev; |
|
1255 | int rev; | |
1256 | if (self->ntrev > 0) { |
|
1256 | if (self->ntrev > 0) { | |
1257 | for (rev = self->ntrev - 1; rev >= 0; rev--) { |
|
1257 | for (rev = self->ntrev - 1; rev >= 0; rev--) { | |
@@ -1348,7 +1348,7 b' static PyObject *index_partialmatch(inde' | |||||
1348 |
|
1348 | |||
1349 | if (index_init_nt(self) == -1) |
|
1349 | if (index_init_nt(self) == -1) | |
1350 | return NULL; |
|
1350 | return NULL; | |
1351 |
if ( |
|
1351 | if (index_populate_nt(self) == -1) | |
1352 | return NULL; |
|
1352 | return NULL; | |
1353 | rev = nt_partialmatch(self->nt, node, nodelen); |
|
1353 | rev = nt_partialmatch(self->nt, node, nodelen); | |
1354 |
|
1354 | |||
@@ -1383,7 +1383,7 b' static PyObject *index_shortest(indexObj' | |||||
1383 | self->ntlookups++; |
|
1383 | self->ntlookups++; | |
1384 | if (index_init_nt(self) == -1) |
|
1384 | if (index_init_nt(self) == -1) | |
1385 | return NULL; |
|
1385 | return NULL; | |
1386 |
if ( |
|
1386 | if (index_populate_nt(self) == -1) | |
1387 | return NULL; |
|
1387 | return NULL; | |
1388 | length = nt_shortest(self->nt, node); |
|
1388 | length = nt_shortest(self->nt, node); | |
1389 | if (length == -3) |
|
1389 | if (length == -3) | |
@@ -1799,7 +1799,7 b' static PyObject *index_ancestors(indexOb' | |||||
1799 | /* |
|
1799 | /* | |
1800 | * Invalidate any trie entries introduced by added revs. |
|
1800 | * Invalidate any trie entries introduced by added revs. | |
1801 | */ |
|
1801 | */ | |
1802 |
static void |
|
1802 | static void index_invalidate_added(indexObject *self, Py_ssize_t start) | |
1803 | { |
|
1803 | { | |
1804 | Py_ssize_t i, len = PyList_GET_SIZE(self->added); |
|
1804 | Py_ssize_t i, len = PyList_GET_SIZE(self->added); | |
1805 |
|
1805 | |||
@@ -1869,7 +1869,7 b' static int index_slice_del(indexObject *' | |||||
1869 | nt_delete_node(self->nt, node); |
|
1869 | nt_delete_node(self->nt, node); | |
1870 | } |
|
1870 | } | |
1871 | if (self->added) |
|
1871 | if (self->added) | |
1872 |
|
|
1872 | index_invalidate_added(self, 0); | |
1873 | if (self->ntrev > start) |
|
1873 | if (self->ntrev > start) | |
1874 | self->ntrev = (int)start; |
|
1874 | self->ntrev = (int)start; | |
1875 | } |
|
1875 | } | |
@@ -1886,7 +1886,7 b' static int index_slice_del(indexObject *' | |||||
1886 | } |
|
1886 | } | |
1887 |
|
1887 | |||
1888 | if (self->nt) { |
|
1888 | if (self->nt) { | |
1889 |
|
|
1889 | index_invalidate_added(self, start - self->length + 1); | |
1890 | if (self->ntrev > start) |
|
1890 | if (self->ntrev > start) | |
1891 | self->ntrev = (int)start; |
|
1891 | self->ntrev = (int)start; | |
1892 | } |
|
1892 | } |
General Comments 0
You need to be logged in to leave comments.
Login now