'next->second' had already been moved into the callback
Signed-off-by: Casey Bodley <cbodley@redhat.com>
typedef std::list<std::pair<cost_t, T> > ListPairs;
static unsigned filter_list_pairs(ListPairs *l,
- std::function<bool (T&&)> f,
- std::list<T>* out = nullptr) {
+ std::function<bool (T&&)> f) {
unsigned ret = 0;
for (typename ListPairs::iterator i = l->end();
i != l->begin();
--next;
if (f(std::move(next->second))) {
++ret;
- if (out) out->push_back(std::move(next->second));
l->erase(next);
} else {
i = next;