From 01e1c61e9fcf4a0b0164a7fe5395a209a50f6905 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 19:22:05 +0300 Subject: Optimize hot loops with direct access, LUTs, and closed-form formulas --- src/text.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/text.c') diff --git a/src/text.c b/src/text.c index c68011f..07ade9d 100644 --- a/src/text.c +++ b/src/text.c @@ -343,6 +343,12 @@ void term_text_repeat(struct term *t, int count) { int screen = t->cols * t->rows; if (count > screen) count = screen; + if (count <= 0 || !t->last_char) + return; + if (count == 1) { + term_sc_print_glyph(t, t->last_char, -1, term_current_flags(t)); + return; + } for (int j = 0; j < count && t->last_char; j++) term_sc_print_glyph(t, t->last_char, -1, term_current_flags(t)); } -- cgit v1.2.3