Replace assert with assume for release build optimization (#1390)

This commit is contained in:
Sylvie
2024-04-02 11:09:31 -04:00
committed by GitHub
parent 1d39e5ed56
commit a234da42a6
26 changed files with 158 additions and 147 deletions

View File

@@ -2542,7 +2542,7 @@ static std::string strfmt(
} else if (auto *n = std::get_if<uint32_t>(&args[argIndex]); n) {
fmt.appendNumber(str, *n);
} else {
assert(std::holds_alternative<std::string>(args[argIndex]));
assume(std::holds_alternative<std::string>(args[argIndex]));
auto &s = std::get<std::string>(args[argIndex]);
fmt.appendString(str, s);
}