[clang-tidy] convert to range for loops

Found with modernize-loop-convert

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-02-20 21:50:59 -08:00 committed by Fabian Homborg
parent 4f4c9aac34
commit b266370428

View File

@ -377,9 +377,7 @@ void inputter_t::mapping_execute(const input_mapping_t &m, bool allow_commands)
return; // skip the input_set_bind_mode
} else if (has_functions && !has_commands) {
// Functions are added at the head of the input queue.
for (wcstring_list_t::const_reverse_iterator it = m.commands.rbegin(),
end = m.commands.rend();
it != end; ++it) {
for (auto it = m.commands.rbegin(), end = m.commands.rend(); it != end; ++it) {
readline_cmd_t code = input_function_get_code(*it).value();
function_push_args(code);
event_queue_.push_front(char_event_t(code, m.seq));
@ -564,7 +562,7 @@ bool input_mapping_set_t::erase(const wcstring &sequence, const wcstring &mode,
bool result = false;
mapping_list_t &ml = user ? mapping_list_ : preset_mapping_list_;
for (std::vector<input_mapping_t>::iterator it = ml.begin(), end = ml.end(); it != end; ++it) {
for (auto it = ml.begin(), end = ml.end(); it != end; ++it) {
if (sequence == it->seq && mode == it->mode) {
ml.erase(it);
result = true;