[Lldb-commits] [PATCH] D154387: [lldb][NFCI] Minor cleanup of default OptionValue::GetSubValue implementation

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 3 13:42:12 PDT 2023


bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This does 2 things:

- Corrects a minor typo (`value subvalue` -> `valid subvalue`)
- Removes an unnecessary instance of `str().c_str()` (creating a temporary std::string from a StringRef just to get a valid null-terminated string).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154387

Files:
  lldb/include/lldb/Interpreter/OptionValue.h


Index: lldb/include/lldb/Interpreter/OptionValue.h
===================================================================
--- lldb/include/lldb/Interpreter/OptionValue.h
+++ lldb/include/lldb/Interpreter/OptionValue.h
@@ -114,8 +114,7 @@
   virtual lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
                                           llvm::StringRef name,
                                           Status &error) const {
-    error.SetErrorStringWithFormat("'%s' is not a value subvalue",
-                                   name.str().c_str());
+    error.SetErrorStringWithFormatv("'{0}' is not a valid subvalue", name);
     return lldb::OptionValueSP();
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154387.536883.patch
Type: text/x-patch
Size: 686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230703/102decee/attachment-0001.bin>


More information about the lldb-commits mailing list