mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
CLEANUP(contentmodel): Use ranges::find_if instead of a loop
This commit is contained in:
parent
40aee53831
commit
fbdc4f4881
1 changed files with 3 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "contentmodel.hpp"
|
||||
#include "esmfile.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue