Commit 3427f489 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac846] Simplify the function

parent 74472396
......@@ -53,17 +53,13 @@ listContains(ConstElementPtr list, ConstElementPtr el) {
void
listRemove(ElementPtr list, ConstElementPtr el) {
int i = 0;
int position = -1;
BOOST_FOREACH(ConstElementPtr s_el, list->listValue()) {
if (*el == *s_el) {
position = i;
break;
list->remove(i);
return;
}
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