summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-10-14 15:12:57 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-10-14 15:13:06 (GMT)
commit75a00ec959d198f8d5de02ba5708b539f7d32a41 (patch)
treeaa809d9012bee31db76a45558578ddd54830c4d8
parent0be92550ad50e25ee80ee5065b916295617c17f4 (diff)
Fix a crash in stlutil
-rw-r--r--src/kleo/stl_util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kleo/stl_util.h b/src/kleo/stl_util.h
index a3f9b31..30bef43 100644
--- a/src/kleo/stl_util.h
+++ b/src/kleo/stl_util.h
@@ -41,8 +41,8 @@ struct filter_iterator
filter_iterator(UnaryPredicate pred, _Iterator it, _Iterator last) : it(it), last(last), pred(pred) {}
template<typename _OtherIter>
filter_iterator(const filter_iterator<_OtherIter, UnaryPredicate> &other) : it(other.it), last(other.last), pred(other.pred) {}
- filter_iterator &operator++() { while (it != last && !pred(*(++it))){} return *this; }
- filter_iterator operator++(int) { auto retval = *this; while(it != last && !pred(++it)){} return retval; }
+ filter_iterator &operator++() { while (++it != last && !pred(*it)){} return *this; }
+ filter_iterator operator++(int) { auto retval = *this; while(++it != last && !pred(*it)){} return retval; }
bool operator==(filter_iterator other) const { return it == other.it; }
bool operator!=(filter_iterator other) const { return it != other.it; }
typename _Iterator::reference operator*() const { return *it; }