1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 01:42:38 +01:00

Codechange: Use std::ranges::find where possible.

Replace `std::find(range.begin(), range.end(), ...)` with `std::ranges::find(range, ...)`.
This commit is contained in:
Peter Nelson
2024-11-10 10:51:26 +00:00
committed by Peter Nelson
parent 1f18894408
commit 3be0166801
31 changed files with 45 additions and 46 deletions

View File

@@ -287,7 +287,7 @@ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary &su
new_item.subtype = GetCargoSubtypeText(v);
if (!IsValidCargoID(new_item.cargo) && new_item.subtype == STR_EMPTY) continue;
auto item = std::find(std::begin(summary), std::end(summary), new_item);
auto item = std::ranges::find(summary, new_item);
if (item == std::end(summary)) {
item = summary.emplace(std::end(summary));
item->cargo = new_item.cargo;