mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-02-03 18:08:14 +01:00
Codechange: Use std::range::find_if where possible.
This commit is contained in:
committed by
Peter Nelson
parent
059a4b22f7
commit
fa1849b855
@@ -1562,7 +1562,7 @@ public:
|
||||
dst.insert(item);
|
||||
} else {
|
||||
/* Search for spec by grfid and local index. */
|
||||
auto it = std::find_if(specs.begin(), specs.end(), [&item](const HouseSpec &spec) { return spec.grf_prop.grffile != nullptr && spec.grf_prop.grffile->grfid == item.grfid && spec.grf_prop.local_id == item.local_id; });
|
||||
auto it = std::ranges::find_if(specs, [&item](const HouseSpec &spec) { return spec.grf_prop.grffile != nullptr && spec.grf_prop.grffile->grfid == item.grfid && spec.grf_prop.local_id == item.local_id; });
|
||||
if (it == specs.end()) {
|
||||
/* Not preset, hide from UI. */
|
||||
dst.insert({item.grfid, item.local_id, -1, -1});
|
||||
|
||||
Reference in New Issue
Block a user