Skip to content

Commit

Permalink
Game Config Manager: simplified a util function
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jan 9, 2021
1 parent 8b3498e commit 148574a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/game_config_manager.cpp
Expand Up @@ -123,14 +123,10 @@ namespace
/** returns true if every define in special is also defined in general */
bool map_includes(const preproc_map& general, const preproc_map& special)
{
for(const auto& pair : special) {
auto it = general.find(pair.first);
if(it == general.end() || it->second != pair.second) {
return false;
}
}

return true;
return std::all_of(special.begin(), special.end(), [&general](const auto& pair) {
const auto it = general.find(pair.first);
return it != general.end() && it->second == pair.second;
});
}
} // end anonymous namespace

Expand Down

0 comments on commit 148574a

Please sign in to comment.