1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00: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:
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

@@ -301,7 +301,7 @@ static void DumpSections(const IniLoadFile &ifile)
/* Output every group, using its name as template name. */
for (const IniGroup &grp : ifile.groups) {
/* Exclude special group names. */
if (std::find(std::begin(special_group_names), std::end(special_group_names), grp.name) != std::end(special_group_names)) continue;
if (std::ranges::find(special_group_names, grp.name) != std::end(special_group_names)) continue;
const IniItem *template_item = templates_grp->GetItem(grp.name); // Find template value.
if (template_item == nullptr || !template_item->value.has_value()) {