Show More
@@ -1151,9 +1151,9 b' static int index_find_node(indexObject *' | |||||
1151 | */ |
|
1151 | */ | |
1152 | if (self->ntmisses++ < 4) { |
|
1152 | if (self->ntmisses++ < 4) { | |
1153 | for (rev = self->ntrev - 1; rev >= 0; rev--) { |
|
1153 | for (rev = self->ntrev - 1; rev >= 0; rev--) { | |
1154 | const char *n = index_node(self, rev); |
|
1154 | const char *n = index_node_existing(self, rev); | |
1155 | if (n == NULL) |
|
1155 | if (n == NULL) | |
1156 |
return - |
|
1156 | return -3; | |
1157 | if (memcmp(node, n, nodelen > 20 ? 20 : nodelen) == 0) { |
|
1157 | if (memcmp(node, n, nodelen > 20 ? 20 : nodelen) == 0) { | |
1158 | if (nt_insert(self, n, rev) == -1) |
|
1158 | if (nt_insert(self, n, rev) == -1) | |
1159 | return -3; |
|
1159 | return -3; | |
@@ -1162,11 +1162,9 b' static int index_find_node(indexObject *' | |||||
1162 | } |
|
1162 | } | |
1163 | } else { |
|
1163 | } else { | |
1164 | for (rev = self->ntrev - 1; rev >= 0; rev--) { |
|
1164 | for (rev = self->ntrev - 1; rev >= 0; rev--) { | |
1165 | const char *n = index_node(self, rev); |
|
1165 | const char *n = index_node_existing(self, rev); | |
1166 |
if (n == NULL) |
|
1166 | if (n == NULL) | |
1167 | self->ntrev = rev + 1; |
|
1167 | return -3; | |
1168 | return -2; |
|
|||
1169 | } |
|
|||
1170 | if (nt_insert(self, n, rev) == -1) { |
|
1168 | if (nt_insert(self, n, rev) == -1) { | |
1171 | self->ntrev = rev + 1; |
|
1169 | self->ntrev = rev + 1; | |
1172 | return -3; |
|
1170 | return -3; | |
@@ -1243,9 +1241,9 b' static int nt_partialmatch(indexObject *' | |||||
1243 | if (self->ntrev > 0) { |
|
1241 | if (self->ntrev > 0) { | |
1244 | /* ensure that the radix tree is fully populated */ |
|
1242 | /* ensure that the radix tree is fully populated */ | |
1245 | for (rev = self->ntrev - 1; rev >= 0; rev--) { |
|
1243 | for (rev = self->ntrev - 1; rev >= 0; rev--) { | |
1246 | const char *n = index_node(self, rev); |
|
1244 | const char *n = index_node_existing(self, rev); | |
1247 | if (n == NULL) |
|
1245 | if (n == NULL) | |
1248 |
return - |
|
1246 | return -3; | |
1249 | if (nt_insert(self, n, rev) == -1) |
|
1247 | if (nt_insert(self, n, rev) == -1) | |
1250 | return -3; |
|
1248 | return -3; | |
1251 | } |
|
1249 | } |
General Comments 0
You need to be logged in to leave comments.
Login now