MCPcopy Create free account
hub / github.com/antirez/ds4 / raxNodeFindChildPos

Function raxNodeFindChildPos

rax.c:294–302  ·  view source on GitHub ↗

Return the position where the edge 'c' should be inserted in order to * preserve lexicographic ordering. */

Source from the content-addressed store, hash-verified

292/* Return the position where the edge 'c' should be inserted in order to
293 * preserve lexicographic ordering. */
294static inline int raxNodeFindChildPos(raxNode *n, unsigned char c) {
295 int pos;
296
297 assert(n->iscompr == 0);
298 for (pos = 0; pos < n->size; pos++) {
299 if (n->data[pos] > c) break;
300 }
301 return pos;
302}
303
304/* Like raxAddChild() but does not allocate the child node. Instead it
305 * returns in 'parentlink' the address of the new child pointer, so that the

Callers 2

raxAddChildNoAllocFunction · 0.85
raxGenericInsertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected