diff --git a/src/blackmisc/sequence.h b/src/blackmisc/sequence.h index a2c9ea96c..8563b09f8 100644 --- a/src/blackmisc/sequence.h +++ b/src/blackmisc/sequence.h @@ -12,7 +12,6 @@ #define BLACKMISC_SEQUENCE_H #include "blackmisc/containerbase.h" -#include "blackmisc/propertyindex.h" #include "blackmisc/mixin/mixinicon.h" #include #include @@ -435,21 +434,6 @@ namespace BlackMisc sort(BlackMisc::Predicates::MemberLess(key1, keys...)); } - //! In-place sort by some properties specified by a list of property indexes. - void sortByProperty(const CSequence &indexes) - { - sort([&indexes](const T &a, const T &b) - { - for (const auto &index : indexes) - { - int cmp = index.comparator()(a, b); - if (cmp < 0) { return true; } - if (cmp > 0) { return false; } - } - return false; - }); - } - //! Return a copy sorted by a given comparator predicate. template CSequence sorted(Predicate p) const @@ -468,14 +452,6 @@ namespace BlackMisc return sorted(BlackMisc::Predicates::MemberLess(key1, keys...)); } - //! Return a copy sorted by some properties specified by a list of property indexes. - CSequence sortedByProperty(const CSequence &indexes) const - { - CSequence result = *this; - result.sortByProperty(indexes); - return result; - } - //! In-place move the smallest n elements to the beginning and sort them. template void partiallySort(size_type n, Predicate p) { diff --git a/tests/blackmisc/testpropertyindex/testpropertyindex.cpp b/tests/blackmisc/testpropertyindex/testpropertyindex.cpp index 91d240067..86c2c3937 100644 --- a/tests/blackmisc/testpropertyindex/testpropertyindex.cpp +++ b/tests/blackmisc/testpropertyindex/testpropertyindex.cpp @@ -74,8 +74,6 @@ namespace BlackMiscTest QVERIFY(v3 == v33 && v3 == 0); QVERIFY(callsigns.front().equalsString("DLH3000")); - callsigns.sortByProperty(indexListCs); - QVERIFY(callsigns.front().equalsString("DLH1000")); CStatusMessage s1(CStatusMessage::SeverityDebug, u"debug msg."); s1.setMSecsSinceEpoch(4000); @@ -110,9 +108,6 @@ namespace BlackMiscTest QVERIFY(msgs.front().getMSecsSinceEpoch() == 4000); QVERIFY(msgs.back().getMSecsSinceEpoch() == 1000); - msgs.sortByProperty(indexList); - QVERIFY(msgs.front().getMSecsSinceEpoch() == 1000); - QVERIFY(msgs.back().getMSecsSinceEpoch() == 4000); } } // namespace