Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/support/istring.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ struct IString {
bool equals(std::string_view other) const { return str.view() == other; }

bool startsWith(std::string_view prefix) const {
// TODO: Use C++20 `starts_with`.
return view().substr(0, prefix.size()) == prefix;
return view().starts_with(prefix);
}
bool startsWith(IString other) const { return startsWith(other.view()); }

Expand All @@ -124,11 +123,7 @@ struct IString {
}

bool endsWith(std::string_view suffix) const {
// TODO: Use C++20 `ends_with`.
if (suffix.size() > str.size()) {
return false;
}
return view().substr(str.size() - suffix.size()) == suffix;
return view().ends_with(suffix);
}
bool endsWith(IString other) const { return endsWith(other.view()); }

Expand Down
Loading