From c8ecc2a9fa3c100ae1c8c3e9ce4a5db452a69206 Mon Sep 17 00:00:00 2001 From: Eugene Zelenko Date: Fri, 19 Feb 2016 19:33:46 +0000 Subject: Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. llvm-svn: 261356 --- lldb/source/Commands/CommandObjectApropos.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'lldb/source/Commands/CommandObjectApropos.cpp') diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp index 47890b1e83b..bf441c09af4 100644 --- a/lldb/source/Commands/CommandObjectApropos.cpp +++ b/lldb/source/Commands/CommandObjectApropos.cpp @@ -7,16 +7,14 @@ // //===----------------------------------------------------------------------===// -#include "CommandObjectApropos.h" - // C Includes // C++ Includes // Other libraries and framework includes // Project includes +#include "CommandObjectApropos.h" #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/Options.h" #include "lldb/Interpreter/Property.h" - #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -28,10 +26,10 @@ using namespace lldb_private; //------------------------------------------------------------------------- CommandObjectApropos::CommandObjectApropos (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "apropos", - "Find a list of debugger commands related to a particular word/subject.", - NULL) + CommandObjectParsed(interpreter, + "apropos", + "Find a list of debugger commands related to a particular word/subject.", + nullptr) { CommandArgumentEntry arg; CommandArgumentData search_word_arg; @@ -47,10 +45,7 @@ CommandObjectApropos::CommandObjectApropos (CommandInterpreter &interpreter) : m_arguments.push_back (arg); } -CommandObjectApropos::~CommandObjectApropos() -{ -} - +CommandObjectApropos::~CommandObjectApropos() = default; bool CommandObjectApropos::DoExecute (Args& args, CommandReturnObject &result) @@ -60,7 +55,7 @@ CommandObjectApropos::DoExecute (Args& args, CommandReturnObject &result) if (argc == 1) { const char *search_word = args.GetArgumentAtIndex(0); - if ((search_word != NULL) + if ((search_word != nullptr) && (strlen (search_word) > 0)) { // The bulk of the work must be done inside the Command Interpreter, since the command dictionary @@ -120,10 +115,8 @@ CommandObjectApropos::DoExecute (Args& args, CommandReturnObject &result) user_commands_help.GetStringAtIndex(i), max_len); } - } - std::vector properties; const size_t num_properties = m_interpreter.GetDebugger().Apropos(search_word, properties); if (num_properties) -- cgit v1.2.3