CVarManager: Use std::any_of for restartRequired()

Same thing, but more concise.
This commit is contained in:
Lioncash 2019-08-20 06:02:47 -04:00
parent a1a18c6816
commit a16327df68
1 changed files with 4 additions and 6 deletions

View File

@ -4,6 +4,7 @@
#include <athena/Utility.hpp>
#include <hecl/Runtime.hpp>
#include <hecl/hecl.hpp>
#include <algorithm>
#include <memory>
#include <regex>
@ -268,12 +269,9 @@ void CVarManager::setCheatsEnabled(bool v, bool setDeserialized) {
}
bool CVarManager::restartRequired() const {
for (const auto& cv : m_cvars) {
if (cv.second->isModified() && cv.second->modificationRequiresRestart())
return true;
}
return false;
return std::any_of(m_cvars.cbegin(), m_cvars.cend(), [](const auto& entry) {
return entry.second->isModified() && entry.second->modificationRequiresRestart();
});
}
void CVarManager::parseCommandLine(const std::vector<SystemString>& args) {