diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-08-22 09:02:54 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-08-22 09:02:54 +0000 |
commit | 1153dc9603c74f85314505abdae28b3f0dc85c39 (patch) | |
tree | 4f32ee69f63bdcbfb94470ae767186cdfb6de47d /lldb/source/Commands/CommandObjectMultiword.cpp | |
parent | 35038c914c187484e65440d204029e716ea1eeca (diff) | |
download | bcm5719-llvm-1153dc9603c74f85314505abdae28b3f0dc85c39.tar.gz bcm5719-llvm-1153dc9603c74f85314505abdae28b3f0dc85c39.zip |
[lldb][NFC] NFC cleanup for the completion code
llvm-svn: 369632
Diffstat (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index ecc73a8cbe9..a223d709535 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -201,20 +201,22 @@ void CommandObjectMultiword::HandleCompletion(CompletionRequest &request) { } } } - } else { - StringList new_matches; - CommandObject *sub_command_object = GetSubcommandObject(arg0, &new_matches); - if (sub_command_object == nullptr) { - request.AddCompletions(new_matches); - } else { - // Remove the one match that we got from calling GetSubcommandObject. - new_matches.DeleteStringAtIndex(0); - request.AddCompletions(new_matches); - request.GetParsedLine().Shift(); - request.SetCursorIndex(request.GetCursorIndex() - 1); - return sub_command_object->HandleCompletion(request); - } + return; } + + StringList new_matches; + CommandObject *sub_command_object = GetSubcommandObject(arg0, &new_matches); + if (sub_command_object == nullptr) { + request.AddCompletions(new_matches); + return; + } + + // Remove the one match that we got from calling GetSubcommandObject. + new_matches.DeleteStringAtIndex(0); + request.AddCompletions(new_matches); + request.GetParsedLine().Shift(); + request.SetCursorIndex(request.GetCursorIndex() - 1); + sub_command_object->HandleCompletion(request); } const char *CommandObjectMultiword::GetRepeatCommand(Args ¤t_command_args, |