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.
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: