diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-02 19:32:44 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-02 19:32:44 +0200 |
commit | 98565127c60cba3d5b747bb9eb698e06d187f45b (patch) | |
tree | 961880f923c670de3d09709ad85ff779987b391f /utils.c | |
parent | 05e910cec691f8333383a746876015e99ff088db (diff) |
extend vlist code to allow keeping the old data structure instead of the new one on updates
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -37,11 +37,16 @@ vlist_add(struct vlist_tree *tree, struct vlist_node *node) anode = avl_find(&tree->avl, key); if (anode) { + if (tree->keep_old) + goto update_only; + old_node = container_of(anode, struct vlist_node, avl); avl_delete(&tree->avl, anode); } avl_insert(&tree->avl, &node->avl); + +update_only: tree->update(tree, node, old_node); } |