rbtree.c: rbtree_walk: pass rbnode->key instead of rbnode to callback function
This commit is contained in:
parent
2c54173a52
commit
0fba36440c
4 changed files with 8 additions and 7 deletions
|
|
@ -94,14 +94,14 @@ static int keyref_exists(int low, int high, int value) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void walk_fn(rbnode *n) {
|
||||
static void walk_fn(const void *key) {
|
||||
|
||||
static int i = 0;
|
||||
|
||||
while(keyref_exists(0, i-1, keyref[i]))
|
||||
i++;
|
||||
|
||||
assert(keyref[i] == *((int*)n->key));
|
||||
assert(keyref[i] == *((int*)key));
|
||||
|
||||
if (++i > NODES)
|
||||
i = 0;
|
||||
|
|
|
|||
Reference in a new issue