Micro optimisation

Dont lookup char props for ascii char at start of draw command.
Improves benchmark by 2-5%
This commit is contained in:
Kovid Goyal 2025-07-26 09:34:13 +05:30
parent 53aea0642f
commit 83bc0423b2
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -1111,7 +1111,7 @@ draw_text_loop(Screen *self, const uint32_t *chars, size_t num_chars, text_loop_
int char_width;
for (size_t i = 0; i < num_chars; i++) {
uint32_t ch = map_char(self, chars[i]);
if (ch < DEL && s->seg.grapheme_break == GBP_None) { // fast path for printable ASCII
if (ch < DEL && s->seg.grapheme_break <= GBP_None) { // fast path for printable ASCII
if (ch < ' ') {
draw_control_char(self, s, ch);
continue;