1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 20:24:12 +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

@@ -490,7 +490,7 @@ struct BuildRailToolbarWindow : Window {
bool can_build = CanBuildVehicleInfrastructure(VEH_TRAIN);
if (can_build) return false;
if (std::find(std::begin(can_build_widgets), std::end(can_build_widgets), widget) == std::end(can_build_widgets)) return false;
if (std::ranges::find(can_build_widgets, widget) == std::end(can_build_widgets)) return false;
GuiShowTooltips(this, STR_TOOLBAR_DISABLED_NO_VEHICLE_AVAILABLE, close_cond);
return true;