Skip to content

Commit

Permalink
remove unused variable (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort authored Apr 6, 2023
1 parent 54cf5fb commit bbace1f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/vcpkg/versions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ namespace vcpkg
Optional<uint64_t> as_numeric(StringView str)
{
uint64_t res = 0;
size_t digits = 0;
for (auto&& ch : str)
{
uint64_t digit_value = static_cast<unsigned char>(ch) - static_cast<unsigned char>('0');
if (digit_value > 9) return nullopt;
if (res > std::numeric_limits<uint64_t>::max() / 10 - digit_value) return nullopt;
++digits;
res = res * 10 + digit_value;
}
return res;
Expand Down

0 comments on commit bbace1f

Please sign in to comment.