[lldb][NFC] NFC cleanup for the completion code
llvm-svn: 369632
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index 811841f..78e19f7 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -205,20 +205,20 @@
// Return the completions of the commands in the help system:
if (request.GetCursorIndex() == 0) {
m_interpreter.HandleCompletionMatches(request);
- } else {
- CommandObject *cmd_obj =
- m_interpreter.GetCommandObject(request.GetParsedLine()[0].ref);
-
- // The command that they are getting help on might be ambiguous, in which
- // case we should complete that, otherwise complete with the command the
- // user is getting help on...
-
- if (cmd_obj) {
- request.GetParsedLine().Shift();
- request.SetCursorIndex(request.GetCursorIndex() - 1);
- cmd_obj->HandleCompletion(request);
- } else {
- m_interpreter.HandleCompletionMatches(request);
- }
+ return;
}
+ CommandObject *cmd_obj =
+ m_interpreter.GetCommandObject(request.GetParsedLine()[0].ref);
+
+ // The command that they are getting help on might be ambiguous, in which
+ // case we should complete that, otherwise complete with the command the
+ // user is getting help on...
+
+ if (cmd_obj) {
+ request.GetParsedLine().Shift();
+ request.SetCursorIndex(request.GetCursorIndex() - 1);
+ cmd_obj->HandleCompletion(request);
+ return;
+ }
+ m_interpreter.HandleCompletionMatches(request);
}