use find_if instead of a loop
This commit is contained in:
parent
c85700366e
commit
37ac605880
|
@ -429,12 +429,10 @@ void move_first(VteTerminal *vte, select_info *select, F is_match) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (long i = 0; i < length; i++) {
|
auto iter = std::find_if(codepoints, codepoints + length, is_match);
|
||||||
if (is_match(codepoints[i])) {
|
if (iter != codepoints + length) {
|
||||||
vte_terminal_set_cursor_position(vte, i, cursor_row);
|
vte_terminal_set_cursor_position(vte, iter - codepoints, cursor_row);
|
||||||
update_selection(vte, select);
|
update_selection(vte, select);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(codepoints);
|
g_free(codepoints);
|
||||||
|
|
Loading…
Reference in New Issue