Fix clang tidy

This commit is contained in:
Igor Pissolati
2026-01-04 16:28:30 -03:00
committed by GitHub
parent 5302900a9d
commit 7112d619b4
2 changed files with 24 additions and 1 deletions

View File

@@ -182,17 +182,21 @@ namespace
const auto key = registry.get_key({R"(\Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion)"});
if (!key)
{
return 0;
}
for (size_t i = 0; const auto value = registry.get_value(*key, i); ++i)
{
if (value->type != REG_SZ)
{
continue;
}
if (value->name == "CurrentBuildNumber" || value->name == "CurrentBuild")
{
const auto* s = reinterpret_cast<const char16_t*>(value->data.data());
return static_cast<uint32_t>(std::wcstoul(reinterpret_cast<const wchar_t*>(s), nullptr, 10));
return utils::string::parse_number<uint32_t>(std::u16string_view(s));
}
}