Author: teemperor Date: Mon Aug 19 00:59:44 2019 New Revision: 369240 URL: http://llvm.org/viewvc/llvm-project?rev=369240&view=rev Log: [lldb][NFC] Use GetMaxStringLength in CommandObjectApropos::DoExecute
Modified: lldb/trunk/source/Commands/CommandObjectApropos.cpp Modified: lldb/trunk/source/Commands/CommandObjectApropos.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectApropos.cpp?rev=369240&r1=369239&r2=369240&view=diff ============================================================================== --- lldb/trunk/source/Commands/CommandObjectApropos.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectApropos.cpp Mon Aug 19 00:59:44 2019 @@ -63,11 +63,7 @@ bool CommandObjectApropos::DoExecute(Arg if (commands_found.GetSize() > 0) { result.AppendMessageWithFormat( "The following commands may relate to '%s':\n", args[0].c_str()); - size_t max_len = 0; - - for (const std::string &command : commands_found) { - max_len = std::max(max_len, command.size()); - } + const size_t max_len = commands_found.GetMaxStringLength(); for (size_t i = 0; i < commands_found.GetSize(); ++i) m_interpreter.OutputFormattedHelpText( _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits