X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6072005ddce81b456fdcf2e77d5156a1d86f3686..e57f6215659ee36877c7c36c9e3fcba0ba5d03a0:/src/kitemviews/kitemset.cpp diff --git a/src/kitemviews/kitemset.cpp b/src/kitemviews/kitemset.cpp index ea96efd11..c8c1ff076 100644 --- a/src/kitemviews/kitemset.cpp +++ b/src/kitemviews/kitemset.cpp @@ -6,7 +6,6 @@ #include "kitemset.h" - KItemSet::iterator KItemSet::insert(int i) { if (m_itemRanges.empty()) { @@ -128,7 +127,7 @@ KItemSet::iterator KItemSet::erase(iterator it) } } -KItemSet KItemSet::operator+(const KItemSet& other) const +KItemSet KItemSet::operator+(const KItemSet &other) const { KItemSet sum; @@ -170,8 +169,7 @@ KItemSet KItemSet::operator+(const KItemSet& other) const count = qMax(count, it2->index + it2->count - index); ++it2; } - } while ((it1 != end1 && it1->index <= index + count) - || (it2 != end2 && it2->index <= index + count)); + } while ((it1 != end1 && it1->index <= index + count) || (it2 != end2 && it2->index <= index + count)); sum.m_itemRanges.append(KItemRange(index, count)); } @@ -180,7 +178,7 @@ KItemSet KItemSet::operator+(const KItemSet& other) const return sum; } -KItemSet KItemSet::operator^(const KItemSet& other) const +KItemSet KItemSet::operator^(const KItemSet &other) const { // We are looking for all ints which are either in *this or in other, // but not in both. @@ -197,14 +195,14 @@ KItemSet KItemSet::operator^(const KItemSet& other) const const QVector::iterator end = rangeBoundaries.end(); QVector::iterator it = begin; - foreach (const KItemRange& range, m_itemRanges) { + for (const KItemRange &range : std::as_const(m_itemRanges)) { *it++ = range.index; *it++ = range.index + range.count; } const QVector::iterator middle = it; - foreach (const KItemRange& range, other.m_itemRanges) { + for (const KItemRange &range : std::as_const(other.m_itemRanges)) { *it++ = range.index; *it++ = range.index + range.count; }