diff --git a/src/common/utils/string.hpp b/src/common/utils/string.hpp index 65f47fc2..a732217d 100644 --- a/src/common/utils/string.hpp +++ b/src/common/utils/string.hpp @@ -181,23 +181,4 @@ namespace utils::string { return std::ranges::equal(lhs, rhs, [](const auto c1, const auto c2) { return char_to_lower(c1) == char_to_lower(c2); }); } - - template - requires(std::is_integral_v) - Integer parse_number(const std::basic_string_view str) - { - Integer result = 0; - - for (const auto ch : str) - { - if (ch < u'0' || ch > u'9') - { - break; - } - - result = result * 10 + static_cast(ch - u'0'); - } - - return result; - } } diff --git a/src/windows-emulator/process_context.cpp b/src/windows-emulator/process_context.cpp index 13437983..534ed420 100644 --- a/src/windows-emulator/process_context.cpp +++ b/src/windows-emulator/process_context.cpp @@ -196,7 +196,7 @@ namespace if (value->name == "CurrentBuildNumber" || value->name == "CurrentBuild") { const auto* s = reinterpret_cast(value->data.data()); - return utils::string::parse_number(std::u16string_view(s)); + return static_cast(std::strtoul(u16_to_u8(s).c_str(), nullptr, 10)); } }