diff options
author | Raphael Isemann <teemperor@gmail.com> | 2020-06-04 10:27:03 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-06-04 10:30:27 +0200 |
commit | 2ebe30c6e4ab1d65fc8605051eb528fc26ffc621 (patch) | |
tree | 150805424fe20cf261484a469dd0b03982489736 /lldb/source/Commands/CommandObjectCommands.cpp | |
parent | 30949926f98576fbff8d5ad0390be5124ffacd7e (diff) | |
download | llvm-2ebe30c6e4ab1d65fc8605051eb528fc26ffc621.zip llvm-2ebe30c6e4ab1d65fc8605051eb528fc26ffc621.tar.gz llvm-2ebe30c6e4ab1d65fc8605051eb528fc26ffc621.tar.bz2 |
[lldb][NFC] Address some review feedback for D80775 ('command script delete' completion)
In the similar review D81128, Jonas pointed out some style errors that also
apply to D80775 (which is already committed). Also applying the changes
suggested there to this code.
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 8f72ed7..8c78803a 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -1770,14 +1770,11 @@ public: void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override { - if (!m_interpreter.HasCommands() || request.GetCursorIndex() != 0) return; - const auto &user_dict = m_interpreter.GetUserCommands(); - for (auto pos = user_dict.begin(); pos != user_dict.end(); ++pos) { - request.TryCompleteCurrentArg(pos->first, pos->second->GetHelp()); - } + for (const auto &c : m_interpreter.GetUserCommands()) + request.TryCompleteCurrentArg(c.first, c.second->GetHelp()); } protected: |