Minor optimize methods std::string using param as char with simpler implementation

This commit is contained in:
Herman Semenov committed 2024-04-10 17:57:05 +03:00
1 parent 22fdf6624c
commit c20cb3f4be
8 files changed
+13 -13

No files matched your search

+2 -2
View File
@@ -686,7 +686,7 @@ bool CBreakPoints::EvaluateLogFormat(DebugInterface *cpu, const std::string &fmt
size_t pos = 0;
while (pos < fmt.size()) {
size_t next = fmt.find_first_of("{", pos);
size_t next = fmt.find_first_of('{', pos);
if (next == fmt.npos) {
// End of the string.
result += fmt.substr(pos);
@@ -697,7 +697,7 @@ bool CBreakPoints::EvaluateLogFormat(DebugInterface *cpu, const std::string &fmt
pos = next;
}
size_t end = fmt.find_first_of("}", next + 1);
size_t end = fmt.find_first_of('}', next + 1);
if (end == fmt.npos) {
// Invalid: every expression needs a { and a }.
return false;