aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-12-22 14:02:18 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-12-23 10:43:13 -0800
commita9448872fec52fc57249934b02a4d4f15f223051 (patch)
treeafdc811a8dbe9646f016d5e3a530e805c12fb57a /lldb/source/Commands/CommandObjectCommands.cpp
parentfcf9479f7d65754cf311d8e5be1046f1ace28945 (diff)
downloadllvm-a9448872fec52fc57249934b02a4d4f15f223051.zip
llvm-a9448872fec52fc57249934b02a4d4f15f223051.tar.gz
llvm-a9448872fec52fc57249934b02a4d4f15f223051.tar.bz2
[lldb] Refactor and simplify GetCommandSPExact interface
GetCommandSPExact is called exaclty once with include_aliases set to true, so make it a default argument. Use early returns to simplify the implementation.
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 0c441dd..3b3cdde 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -464,7 +464,7 @@ protected:
OptionArgVectorSP(new OptionArgVector);
if (CommandObjectSP cmd_obj_sp =
- m_interpreter.GetCommandSPExact(cmd_obj.GetCommandName(), false)) {
+ m_interpreter.GetCommandSPExact(cmd_obj.GetCommandName())) {
if (m_interpreter.AliasExists(alias_command) ||
m_interpreter.UserCommandExists(alias_command)) {
result.AppendWarningWithFormat(
@@ -558,10 +558,9 @@ protected:
if (!args.empty()) {
CommandObjectSP tmp_sp =
- m_interpreter.GetCommandSPExact(cmd_obj->GetCommandName(), false);
+ m_interpreter.GetCommandSPExact(cmd_obj->GetCommandName());
if (use_subcommand)
- tmp_sp = m_interpreter.GetCommandSPExact(sub_cmd_obj->GetCommandName(),
- false);
+ tmp_sp = m_interpreter.GetCommandSPExact(sub_cmd_obj->GetCommandName());
args.GetCommandString(args_string);
}