pike.git
/
src
/
post_modules
/
CritBit
/
tree_low.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/CritBit/tree_low.c:401:
bit = CB_GET_BIT(key.str, size); /* printf("bit is %u\n", bit); */ if (CB_S_EQ(size, node->key.len)) { /* node is substring */ if (CB_HAS_CHILD(node, bit)) { node = CB_CHILD(node, bit); continue; }
-
if (
!
bit && CB_HAS_CHILD(node,
1
))
{
+
+
/* this is not very elegant */
+
if (bit && CB_HAS_CHILD(node,
0
))
+
node = cb_find_last(CB_CHILD(node, 0));
+
+
/* just find the next node */
WALK_FORWARD(node, { if (CB_HAS_VALUE(_)) return _; });
-
}
+
return NULL; } if (!bit) break; WALK_UP(node, bit, { if (!bit && CB_HAS_CHILD(_, 1)) { _ = CB_CHILD(_, 1); break;