MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / raxCloneWithCallback

Function raxCloneWithCallback

src/util/rax_extensions.c:41–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41rax *raxCloneWithCallback(rax *orig, void *(*clone_callback)(void *)) {
42 rax *clone = raxNew();
43
44 raxIterator it;
45 raxStart(&it, orig);
46 raxSeek(&it, "^", NULL, 0);
47
48 // For each key in the original, duplicate the key and its value in the clone.
49 while(raxNext(&it)) {
50 void *data = clone_callback(it.data);
51 raxInsert(clone, it.key, it.key_len, data, NULL);
52 }
53
54 raxStop(&it);
55 return clone;
56}
57
58void **raxValues(rax *rax) {
59 // Instantiate an array to hold all of the values in the rax.

Callers 2

MergeCloneFunction · 0.85
UpdateCloneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected