1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-02-01 00:24:27 +01:00

Codechange: Use more std::string_view.

This commit is contained in:
frosch
2025-04-30 12:40:07 +02:00
committed by frosch
parent 9cf36dac39
commit 316279f4b4
6 changed files with 39 additions and 48 deletions

View File

@@ -215,8 +215,8 @@ static bool IsSameScript(const ContentInfo &ci, bool md5sum, ScriptInfo *info, S
if (tar.second.tar_filename != iter->first) continue;
/* Check the extension. */
const char *ext = strrchr(tar.first.c_str(), '.');
if (ext == nullptr || !StrEqualsIgnoreCase(ext, ".nut")) continue;
auto ext = tar.first.rfind('.');
if (ext == std::string_view::npos || !StrEqualsIgnoreCase(tar.first.substr(ext), ".nut")) continue;
checksum.AddFile(tar.first, 0, tar_filename);
}