Show More
@@ -994,9 +994,6 b' static int nt_find(indexObject *self, co' | |||||
994 | if (nodelen == 20 && node[0] == '\0' && memcmp(node, nullid, 20) == 0) |
|
994 | if (nodelen == 20 && node[0] == '\0' && memcmp(node, nullid, 20) == 0) | |
995 | return -1; |
|
995 | return -1; | |
996 |
|
996 | |||
997 | if (self->nt == NULL) |
|
|||
998 | return -2; |
|
|||
999 |
|
||||
1000 | if (hex) |
|
997 | if (hex) | |
1001 | maxlevel = nodelen > 40 ? 40 : (int)nodelen; |
|
998 | maxlevel = nodelen > 40 ? 40 : (int)nodelen; | |
1002 | else |
|
999 | else | |
@@ -1133,14 +1130,14 b' static int index_find_node(indexObject *' | |||||
1133 | { |
|
1130 | { | |
1134 | int rev; |
|
1131 | int rev; | |
1135 |
|
1132 | |||
|
1133 | if (nt_init(self) == -1) | |||
|
1134 | return -3; | |||
|
1135 | ||||
1136 | self->ntlookups++; |
|
1136 | self->ntlookups++; | |
1137 | rev = nt_find(self, node, nodelen, 0); |
|
1137 | rev = nt_find(self, node, nodelen, 0); | |
1138 | if (rev >= -1) |
|
1138 | if (rev >= -1) | |
1139 | return rev; |
|
1139 | return rev; | |
1140 |
|
1140 | |||
1141 | if (nt_init(self) == -1) |
|
|||
1142 | return -3; |
|
|||
1143 |
|
||||
1144 | /* |
|
1141 | /* | |
1145 | * For the first handful of lookups, we scan the entire index, |
|
1142 | * For the first handful of lookups, we scan the entire index, | |
1146 | * and cache only the matching nodes. This optimizes for cases |
|
1143 | * and cache only the matching nodes. This optimizes for cases |
General Comments 0
You need to be logged in to leave comments.
Login now