Don't run through the column unchanged case if the row was unchanged but there

were no suitable optimisations, instead make it an else to fall through to
absolute addressing.
This commit is contained in:
Nicholas Marriott 2009-10-12 16:41:02 +00:00
parent eb9826f65d
commit 693b3d03e6
1 changed files with 9 additions and 4 deletions

13
tty.c
View File

@ -968,8 +968,12 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
goto out; goto out;
} }
/* Row staying the same. */ /* Moving column or row. */
if (cy == thisy) { if (cy == thisy) {
/*
* Moving column only, row staying the same.
*/
/* To left edge. */ /* To left edge. */
if (cx == 0) { if (cx == 0) {
tty_putc(tty, '\r'); tty_putc(tty, '\r');
@ -1005,10 +1009,11 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
tty_putcode1(tty, TTYC_CUF, -change); tty_putcode1(tty, TTYC_CUF, -change);
goto out; goto out;
} }
} } else if (cx == thisx) {
/*
* Moving row only, column staying the same.
*/
/* Column staying the same. */
if (cx == thisx ) {
/* One above. */ /* One above. */
if (cy != tty->rupper && if (cy != tty->rupper &&
cy == thisy - 1 && tty_term_has(term, TTYC_CUU1)) { cy == thisy - 1 && tty_term_has(term, TTYC_CUU1)) {