Permalink
Browse files

src/lib/list.c: __merge_str_list(): re-prioritize list

Before this commit, values were added from the 'old' list, then from
the 'add' list (provided they were not already added before).

Now, values from the 'add' list takes precedence over the values
from the 'old' list. In other words, values from the 'old' list
are not added if the same values are to be added from the 'add' list.

Should not have any visible effect per se, other than putting the
values from 'add' list to the end of the merged list.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
  • Loading branch information...
1 parent 2f67324 commit e3d0346df314560c187992557518e4d1a073256f @kolyshkin kolyshkin committed Jul 5, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/lib/list.c
View
@@ -214,15 +214,15 @@ int __merge_str_list(int delall, list_head_t *old, list_head_t *add,
if (!delall && !list_empty(old)) {
/* add old values */
list_for_each(str, old, list) {
+ if (find_fn(add, str->val))
+ continue;
if (find_fn(del, str->val))
continue;
add_str_param(merged, str->val);
}
}
if (!list_empty(add)) {
list_for_each(str, add, list) {
- if (find_fn(merged, str->val))
- continue;
if (find_fn(del, str->val))
continue;
add_str_param(merged, str->val);

0 comments on commit e3d0346

Please sign in to comment.