Commit 74472396 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac846] Fix confused test function

It seemed this function is supposed to remove given element from list,
but the counting was somehow confused.
parent e5cae846
......@@ -52,15 +52,17 @@ listContains(ConstElementPtr list, ConstElementPtr el) {
void
listRemove(ElementPtr list, ConstElementPtr el) {
int i = -1;
int i = 0;
int position = -1;
BOOST_FOREACH(ConstElementPtr s_el, list->listValue()) {
if (*el == *s_el) {
i = 0;
position = i;
break;
}
i++;
}
if (i >= 0) {
list->remove(i);
if (position >= 0) {
list->remove(position);
}
}
// endwant
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment