1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 08:52:40 +01:00

Codechange: Pass span to StrValid instead of first and last - 1. (#12846)

`std::span` is used instead of `std::string_view` as this is only used for fixed-length buffers.

This removes some callers of `lastof()`
This commit is contained in:
Peter Nelson
2024-07-08 08:36:57 +01:00
committed by GitHub
parent 23bcd592a4
commit aee04e7bc6
3 changed files with 20 additions and 17 deletions

View File

@@ -1878,12 +1878,12 @@ bool LanguagePackHeader::IsValid() const
this->newgrflangid < MAX_LANG &&
this->num_genders < MAX_NUM_GENDERS &&
this->num_cases < MAX_NUM_CASES &&
StrValid(this->name, lastof(this->name)) &&
StrValid(this->own_name, lastof(this->own_name)) &&
StrValid(this->isocode, lastof(this->isocode)) &&
StrValid(this->digit_group_separator, lastof(this->digit_group_separator)) &&
StrValid(this->digit_group_separator_currency, lastof(this->digit_group_separator_currency)) &&
StrValid(this->digit_decimal_separator, lastof(this->digit_decimal_separator));
StrValid(this->name) &&
StrValid(this->own_name) &&
StrValid(this->isocode) &&
StrValid(this->digit_group_separator) &&
StrValid(this->digit_group_separator_currency) &&
StrValid(this->digit_decimal_separator);
}
/**