replace move_to_eol loop with std::find

This commit is contained in:
Daniel Micay 2012-11-09 18:50:16 -05:00
parent 37ac605880
commit abf07337c5
1 changed files with 2 additions and 8 deletions

View File

@ -467,14 +467,8 @@ static void move_to_eol(VteTerminal *vte, select_info *select) {
return;
}
long column = 0;
for (; column < length; column++) {
if (codepoints[column] == '\n') {
column = std::max(column - 1, 0l);
break;
}
}
set_cursor_column(vte, select, column);
auto iter = std::find(codepoints, codepoints + length, '\n');
set_cursor_column(vte, select, std::max(iter - codepoints - 1, 0l));
g_free(codepoints);
g_free(content);