diff --git a/hecl/lib/Project.cpp b/hecl/lib/Project.cpp index f84ddce66..0fd76e060 100644 --- a/hecl/lib/Project.cpp +++ b/hecl/lib/Project.cpp @@ -1,4 +1,6 @@ #include + +#include #include #include #include @@ -105,16 +107,13 @@ void Project::ConfigFile::removeLine(std::string_view refLine) { } } -bool Project::ConfigFile::checkForLine(std::string_view refLine) { +bool Project::ConfigFile::checkForLine(std::string_view refLine) const { if (!m_lockedFile) { LogModule.reportSource(logvisor::Fatal, __FILE__, __LINE__, fmt("Project::ConfigFile::lockAndRead not yet called")); return false; } - for (const std::string& line : m_lines) - if (line == refLine) - return true; - return false; + return std::any_of(m_lines.cbegin(), m_lines.cend(), [&refLine](const auto& line) { return line == refLine; }); } void Project::ConfigFile::unlockAndDiscard() {