1
0
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:
Peter Nelson
2024-11-10 10:57:48 +00:00
committed by Peter Nelson
parent 059a4b22f7
commit fa1849b855
10 changed files with 12 additions and 12 deletions

View File

@@ -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});