Skip to content

Commit

Permalink
use starts_with
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Sep 22, 2023
1 parent 15cb81f commit d2e8ac2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ std::string budget::format_money_reverse(const budget::money& m) {
size_t budget::rsize(const std::string& value) {
auto v = value;

if (v.substr(0, 5) == "::red") {
if (v.starts_with("::red")) {
v = v.substr(5);
} else if (v.substr(0, 7) == "::green") {
} else if (v.starts_with("::green")) {
v = v.substr(7);
}

Expand Down

0 comments on commit d2e8ac2

Please sign in to comment.