diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index f8d6264a8d..0fa1a64266 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -1,6 +1,7 @@ #include "contentmodel.hpp" #include "esmfile.hpp" +#include #include #include #include @@ -672,14 +673,8 @@ void ContentSelectorModel::ContentModel::setNonUserContent(const QStringList& fi for (auto* file : mFiles) file->setFromAnotherConfigFile(mNonUserContent.contains(file->fileName().toLower())); - int insertPosition = 0; - - for (auto* file : mFiles) - { - if (!file->builtIn()) - break; - ++insertPosition; - } + int insertPosition + = std::ranges::find_if(mFiles, [](const EsmFile* file) { return !file->builtIn(); }) - mFiles.begin(); for (const auto& filepath : fileList) {