summaryrefslogtreecommitdiffhomepage
path: root/utils.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-02 19:40:03 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-02 19:40:03 +0200
commit13ec81ce3e2f77504818de0bf89a2a1edd7e0ba2 (patch)
tree73ed054d727c778c4f07bf54e7fbb2a9a3fe64e3 /utils.c
parent98565127c60cba3d5b747bb9eb698e06d187f45b (diff)
vlist: store a pointer to the real key to make lookups easier
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index a67a8c9..cc22290 100644
--- a/utils.c
+++ b/utils.c
@@ -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;