From a9448872fec52fc57249934b02a4d4f15f223051 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 22 Dec 2020 14:02:18 -0800 Subject: [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. --- lldb/source/Commands/CommandObjectCommands.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') 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); } -- cgit v1.1