mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-25 05:04:07 +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
@@ -2218,7 +2218,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data)
|
||||
if (!T::IsValidID(sid)) return false;
|
||||
|
||||
BaseStation *st = BaseStation::Get(sid);
|
||||
if (st->owner != _local_company || std::find(_stations_nearby_list.begin(), _stations_nearby_list.end(), sid) != _stations_nearby_list.end()) return false;
|
||||
if (st->owner != _local_company || std::ranges::find(_stations_nearby_list, sid) != _stations_nearby_list.end()) return false;
|
||||
|
||||
if (st->rect.BeforeAddRect(ctx->tile, ctx->w, ctx->h, StationRect::ADD_TEST).Succeeded()) {
|
||||
_stations_nearby_list.push_back(sid);
|
||||
|
||||
Reference in New Issue
Block a user