X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/de3e2ae40f626c1368dfd40bace54ef3e7815833..85241a924:/src/kitemviews/private/kfileitemmodelsortalgorithm.h diff --git a/src/kitemviews/private/kfileitemmodelsortalgorithm.h b/src/kitemviews/private/kfileitemmodelsortalgorithm.h index 3c875ce5a..ff484a7e8 100644 --- a/src/kitemviews/private/kfileitemmodelsortalgorithm.h +++ b/src/kitemviews/private/kfileitemmodelsortalgorithm.h @@ -22,8 +22,7 @@ #ifndef KFILEITEMMODELSORTALGORITHM_H #define KFILEITEMMODELSORTALGORITHM_H -#include -#include +#include #include @@ -38,7 +37,7 @@ template static void mergeSort(RandomAccessIterator begin, RandomAccessIterator end, - LessThan lessThan) + const LessThan& lessThan) { // The implementation is based on qStableSortHelper() from qalgorithms.h // Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). @@ -100,7 +99,7 @@ template static void merge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, - LessThan lessThan) + const LessThan& lessThan) { // The implementation is based on qMerge() from qalgorithms.h // Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). @@ -125,12 +124,14 @@ static void merge(RandomAccessIterator begin, if (len1 > len2) { const int len1Half = len1 / 2; firstCut = begin + len1Half; - secondCut = std::lower_bound(pivot, end, *firstCut, lessThan); + secondCut = std::lower_bound(pivot, end, *firstCut, lessThan); len2Half = secondCut - pivot; } else { len2Half = len2 / 2; secondCut = pivot + len2Half; - firstCut = std::upper_bound(begin, pivot, *secondCut, lessThan); + firstCut = std::upper_bound(begin, pivot, *secondCut, lessThan); } std::rotate(firstCut, pivot, secondCut);