diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-02 19:40:03 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-02 19:40:03 +0200 |
commit | 13ec81ce3e2f77504818de0bf89a2a1edd7e0ba2 (patch) | |
tree | 73ed054d727c778c4f07bf54e7fbb2a9a3fe64e3 /utils.c | |
parent | 98565127c60cba3d5b747bb9eb698e06d187f45b (diff) |
vlist: store a pointer to the real key to make lookups easier
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -11,7 +11,7 @@ void __vlist_init(struct vlist_tree *tree, avl_tree_comp cmp, vlist_update_cb update, int offset) { - tree->node_offset = offset; + tree->key_offset = offset; tree->update = update; tree->version = 1; @@ -30,7 +30,7 @@ vlist_add(struct vlist_tree *tree, struct vlist_node *node) { struct vlist_node *old_node = NULL; struct avl_node *anode; - void *key = (char *) node - tree->node_offset; + void *key = (char *) node + tree->key_offset; node->avl.key = key; node->version = tree->version; |