diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 19:22:05 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 19:22:05 +0300 |
| commit | 01e1c61e9fcf4a0b0164a7fe5395a209a50f6905 (patch) | |
| tree | 1f1eb33e49eab338650a42e8f602af75d8d28a24 /src/text.c | |
| parent | 2d02d39d2cd32e9eb559638865d2746f02c08556 (diff) | |
Optimize hot loops with direct access, LUTs, and closed-form formulas
Diffstat (limited to 'src/text.c')
| -rw-r--r-- | src/text.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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)); } |
