This removes duplicated initialization of variables (after reordering
'c' initialization).
It will also allow for eliminating whole translation into a separate
function in the next patch.
Note that vc_state, vc_utf etc. are checked with every rescan now. But
they are immutable for non-control characters where rescan might be
only necessary.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200615074910.19267-15-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
while (!tty->stopped && count) {
int orig = *buf;
- c = orig;
buf++;
n++;
count--;
+rescan_last_byte:
+ c = orig;
rescan = false;
inverse = false;
width = 1;
if (vc->vc_state != ESnormal) {
tc = c;
} else if (vc->vc_utf && !vc->vc_disp_ctrl) {
-rescan_last_byte:
tc = c = vc_translate_unicode(vc, c, &rescan);
if (tc == -1)
continue;
if (inverse)
con_flush(vc, draw_from, draw_to, &draw_x);
- if (rescan) {
- rescan = false;
- inverse = false;
- width = 1;
- c = orig;
+ if (rescan)
goto rescan_last_byte;
- }
+
continue;
}
con_flush(vc, draw_from, draw_to, &draw_x);