Skip to content

Commit 1b29a84

Browse files
committed
[lldb][NFCI] Avoid construction of temporary std::strings in RegisterValue
Differential Revision: https://reviews.llvm.org/D155030
1 parent f0a955d commit 1b29a84

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lldb/source/Utility/RegisterValue.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,8 @@ Status RegisterValue::SetValueFromString(const RegisterInfo *reg_info,
342342
break;
343343
}
344344
if (value_str.getAsInteger(0, uval64)) {
345-
error.SetErrorStringWithFormat(
346-
"'%s' is not a valid unsigned integer string value",
347-
value_str.str().c_str());
345+
error.SetErrorStringWithFormatv(
346+
"'{0}' is not a valid unsigned integer string value", value_str);
348347
break;
349348
}
350349

@@ -371,9 +370,8 @@ Status RegisterValue::SetValueFromString(const RegisterInfo *reg_info,
371370
}
372371

373372
if (value_str.getAsInteger(0, ival64)) {
374-
error.SetErrorStringWithFormat(
375-
"'%s' is not a valid signed integer string value",
376-
value_str.str().c_str());
373+
error.SetErrorStringWithFormatv(
374+
"'{0}' is not a valid signed integer string value", value_str);
377375
break;
378376
}
379377

0 commit comments

Comments
 (0)