aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-01-23 21:36:25 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-01-23 21:36:25 +0000
commit9dba64be9536c28e4800e06512b7f29b43ade345 (patch)
tree7f0f30947225ecb30ab0fdae8059a936537b0dfe /contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp
parent85868e8a1daeaae7a0e48effb2ea2310ae3b02c6 (diff)
parentead246455adf1a215ec2715dad6533073a6beb4e (diff)
Notes
Diffstat (limited to 'contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp b/contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp
index 957de475569c..7ba0b250fbd5 100644
--- a/contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp
+++ b/contrib/llvm-project/lldb/source/Commands/CommandObjectApropos.cpp
@@ -44,7 +44,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
const size_t argc = args.GetArgumentCount();
if (argc == 1) {
- auto search_word = args[0].ref;
+ auto search_word = args[0].ref();
if (!search_word.empty()) {
// The bulk of the work must be done inside the Command Interpreter,
// since the command dictionary is private.
@@ -63,13 +63,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
if (commands_found.GetSize() > 0) {
result.AppendMessageWithFormat(
"The following commands may relate to '%s':\n", args[0].c_str());
- size_t max_len = 0;
-
- for (size_t i = 0; i < commands_found.GetSize(); ++i) {
- size_t len = strlen(commands_found.GetStringAtIndex(i));
- if (len > max_len)
- max_len = len;
- }
+ const size_t max_len = commands_found.GetMaxStringLength();
for (size_t i = 0; i < commands_found.GetSize(); ++i)
m_interpreter.OutputFormattedHelpText(
@@ -85,7 +79,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
const bool dump_qualified_name = true;
result.AppendMessageWithFormatv(
"\nThe following settings variables may relate to '{0}': \n\n",
- args[0].ref);
+ args[0].ref());
for (size_t i = 0; i < num_properties; ++i)
properties[i]->DumpDescription(
m_interpreter, result.GetOutputStream(), 0, dump_qualified_name);