1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +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

@@ -27,7 +27,7 @@ void StrMakeValidInPlace(char *str, StringValidationSettings settings = SVS_REPL
bool strtolower(std::string &str, std::string::size_type offs = 0);
[[nodiscard]] bool StrValid(const char *str, const char *last) NOACCESS(2);
[[nodiscard]] bool StrValid(std::span<const char> str);
void StrTrimInPlace(std::string &str);
std::string_view StrTrimView(std::string_view str);