Skip to content

Commit

Permalink
fix: iterator is not pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Jan 15, 2025
1 parent ed5c8e5 commit a7c76bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/fcitx-utils/semver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool isIdChar(char c) {
}

std::optional<uint32_t> consumeNumericIdentifier(std::string_view &str) {
const auto *endOfNum =
auto endOfNum =
std::find_if_not(str.begin(), str.end(), charutils::isdigit);
auto length = std::distance(str.begin(), endOfNum);
if (length == 0) {
Expand All @@ -45,8 +45,8 @@ std::optional<uint32_t> consumeNumericIdentifier(std::string_view &str) {

auto numberStr = str.substr(0, length);
uint32_t number;
if (auto [p, ec] =
std::from_chars(numberStr.begin(), numberStr.end(), number);
if (auto [p, ec] = std::from_chars(
numberStr.data(), numberStr.data() + numberStr.size(), number);
ec == std::errc()) {
str.remove_prefix(length);
return number;
Expand Down

0 comments on commit a7c76bb

Please sign in to comment.