mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-06 05:07:55 +00:00
Game Config Manager: simplified a util function
This commit is contained in:
parent
8b3498e3c5
commit
148574a3a9
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user