mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
[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:
parent
4f4c9aac34
commit
b266370428
|
@ -377,9 +377,7 @@ void inputter_t::mapping_execute(const input_mapping_t &m, bool allow_commands)
|
||||||
return; // skip the input_set_bind_mode
|
return; // skip the input_set_bind_mode
|
||||||
} else if (has_functions && !has_commands) {
|
} else if (has_functions && !has_commands) {
|
||||||
// Functions are added at the head of the input queue.
|
// Functions are added at the head of the input queue.
|
||||||
for (wcstring_list_t::const_reverse_iterator it = m.commands.rbegin(),
|
for (auto it = m.commands.rbegin(), end = m.commands.rend(); it != end; ++it) {
|
||||||
end = m.commands.rend();
|
|
||||||
it != end; ++it) {
|
|
||||||
readline_cmd_t code = input_function_get_code(*it).value();
|
readline_cmd_t code = input_function_get_code(*it).value();
|
||||||
function_push_args(code);
|
function_push_args(code);
|
||||||
event_queue_.push_front(char_event_t(code, m.seq));
|
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;
|
bool result = false;
|
||||||
mapping_list_t &ml = user ? mapping_list_ : preset_mapping_list_;
|
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) {
|
if (sequence == it->seq && mode == it->mode) {
|
||||||
ml.erase(it);
|
ml.erase(it);
|
||||||
result = true;
|
result = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user