[lldb][NFC] Use GetMaxStringLength in CommandObjectApropos::DoExecute
authorRaphael Isemann <teemperor@gmail.com>
Mon, 19 Aug 2019 07:59:44 +0000 (07:59 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Mon, 19 Aug 2019 07:59:44 +0000 (07:59 +0000)
llvm-svn: 369240

lldb/source/Commands/CommandObjectApropos.cpp

index d336a16..b0ef03a 100644 (file)
@@ -63,11 +63,7 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
         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(