From d2b7a1a321d5cf496860f717eccdfb9487621169 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 28 May 2020 19:48:21 +0200 Subject: Expose ModDataContentHolder from OrganizerCore instead of vector of Content. --- src/modlistsortproxy.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 321722f5..b56dff78 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -184,16 +184,12 @@ bool ModListSortProxy::lessThan(const QModelIndex &left, auto& rContents = rightMod->getContents(); unsigned int lValue = 0; unsigned int rValue = 0; - for (auto& content : m_Organizer->modDataContents()) { - if (!content.isOnlyForFilter()) { - if (std::find(std::begin(lContents), std::end(lContents), content.id()) != std::end(lContents)) { - lValue += 2U << static_cast(content.id()); - } - if (std::find(std::begin(rContents), std::end(rContents), content.id()) != std::end(rContents)) { - rValue += 2U << static_cast(content.id()); - } - } - } + m_Organizer->modDataContents().forEachContentIn(lContents, [&lValue](auto const& content) { + lValue += 2U << static_cast(content.id()); + }); + m_Organizer->modDataContents().forEachContentIn(rContents, [&rValue](auto const& content) { + rValue += 2U << static_cast(content.id()); + }); lt = lValue < rValue; } break; case ModList::COL_NAME: { -- cgit v1.3.1