diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-08-16 14:27:35 +0000 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-08-16 14:27:35 +0000 |
| commit | 4c78b7882506957febf4318978d31b5aaae7cced (patch) | |
| tree | 57b4c6df88edcf2ba5ae517d0a00a993630c3067 /lldb/source/Commands/CommandObjectApropos.cpp | |
| parent | 213edc34922afa08f8cf070017fcd398b12f15a5 (diff) | |
| download | bcm5719-llvm-4c78b7882506957febf4318978d31b5aaae7cced.tar.gz bcm5719-llvm-4c78b7882506957febf4318978d31b5aaae7cced.zip | |
[lldb][NFC] Allow for-ranges on StringList
llvm-svn: 369113
Diffstat (limited to 'lldb/source/Commands/CommandObjectApropos.cpp')
| -rw-r--r-- | lldb/source/Commands/CommandObjectApropos.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp index 957de475569..d336a1652a9 100644 --- a/lldb/source/Commands/CommandObjectApropos.cpp +++ b/lldb/source/Commands/CommandObjectApropos.cpp @@ -65,10 +65,8 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) { "The following commands may relate to '%s':\n", args[0].c_str()); size_t max_len = 0; - for (size_t i = 0; i < commands_found.GetSize(); ++i) { - size_t len = strlen(commands_found.GetStringAtIndex(i)); - if (len > max_len) - max_len = len; + for (const std::string &command : commands_found) { + max_len = std::max(max_len, command.size()); } for (size_t i = 0; i < commands_found.GetSize(); ++i) |

