1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 19:54:06 +01:00

Codechange: pass the characters to trim to StrTrimView

This commit is contained in:
Rubidium
2025-05-03 08:05:54 +02:00
committed by rubidium42
parent e2db8277b8
commit 1f39d469ff
8 changed files with 16 additions and 11 deletions

View File

@@ -96,7 +96,7 @@ static const std::initializer_list<KeycodeNames> _keycode_to_name = {
*/
static std::optional<uint16_t> ParseCode(std::string_view keystr)
{
keystr = StrTrimView(keystr);
keystr = StrTrimView(keystr, StringConsumer::WHITESPACE_NO_NEWLINE);
for (const auto &kn : _keycode_to_name) {
if (StrEqualsIgnoreCase(keystr, kn.name)) {
return kn.keycode;