|
@@ -53,17 +53,13 @@ listContains(ConstElementPtr list, ConstElementPtr el) {
|
|
void
|
|
void
|
|
listRemove(ElementPtr list, ConstElementPtr el) {
|
|
listRemove(ElementPtr list, ConstElementPtr el) {
|
|
int i = 0;
|
|
int i = 0;
|
|
- int position = -1;
|
|
|
|
BOOST_FOREACH(ConstElementPtr s_el, list->listValue()) {
|
|
BOOST_FOREACH(ConstElementPtr s_el, list->listValue()) {
|
|
if (*el == *s_el) {
|
|
if (*el == *s_el) {
|
|
- position = i;
|
|
|
|
- break;
|
|
|
|
|
|
+ list->remove(i);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
i++;
|
|
i++;
|
|
}
|
|
}
|
|
- if (position >= 0) {
|
|
|
|
- list->remove(position);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
// endwant
|
|
// endwant
|
|
|
|
|