3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-14 21:01:49 +00:00

Remove custom starts_with methods in favor of C++20 std::string::starts_with

The custom starts_with() helper methods are redundant since Z3 uses C++20,
which includes std::string::starts_with() as a member function. Updated all
call sites to use the standard library method.

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-12 08:24:53 +00:00
parent bb177988eb
commit fce08b2941

View file

@ -73,7 +73,7 @@ public:
i++;
m_used_options_with_after_string[ar] = m_args[i];
} else {
if (starts_with(ar, "-") || starts_with(ar, "//"))
if (ar.starts_with("-") || ar.starts_with("//"))
status_is_ok = false;
m_free_args.push_back(ar);
@ -99,19 +99,11 @@ public:
return "";
}
bool starts_with(const std::string& s, const std::string& prefix) const {
return s.size() >= prefix.size() && s.compare(0, prefix.size(), prefix) == 0;
}
bool starts_with(const std::string& s, const char* prefix) const {
return starts_with(s, std::string(prefix));
}
std::string usage_string() {
std::string ret = "";
std::vector<std::string> unknown_options;
for (const auto & t : m_free_args) {
if (starts_with(t, "-") || starts_with(t, "\\")) {
if (t.starts_with("-") || t.starts_with("\\")) {
unknown_options.push_back(t);
}
}