mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-21 03:12:41 +01:00
Codechange: use const auto & instead of making a copy
This commit is contained in:
@@ -189,7 +189,7 @@ size_t OneOfManySettingDesc::ParseSingleValue(const char *str, size_t len, const
|
||||
if (isdigit(*str)) return std::strtoul(str, nullptr, 0);
|
||||
|
||||
size_t idx = 0;
|
||||
for (auto one : many) {
|
||||
for (const auto &one : many) {
|
||||
if (one.size() == len && strncmp(one.c_str(), str, len) == 0) return idx;
|
||||
idx++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user