mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-30 23:54:35 +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:
committed by
Peter Nelson
parent
1f18894408
commit
3be0166801
@@ -379,7 +379,7 @@ static std::tuple<CommandCost, uint, uint16_t, CargoArray> RefitVehicle(Vehicle
|
||||
/* Reset actual_subtype for every new vehicle */
|
||||
if (!v->IsArticulatedPart()) actual_subtype = new_subtype;
|
||||
|
||||
if (v->type == VEH_TRAIN && std::find(vehicles_to_refit.begin(), vehicles_to_refit.end(), v->index) == vehicles_to_refit.end() && !only_this) continue;
|
||||
if (v->type == VEH_TRAIN && std::ranges::find(vehicles_to_refit, v->index) == vehicles_to_refit.end() && !only_this) continue;
|
||||
|
||||
const Engine *e = v->GetEngine();
|
||||
if (!e->CanCarryCargo()) continue;
|
||||
|
||||
Reference in New Issue
Block a user