vt: utf8-print: check base character before count when looking for existing compose chain

Count is more likely to be the same for many chains. Thus we’re likely
to fail sooner by checking the base character first.
This commit is contained in:
Daniel Eklöf 2021-06-15 08:40:23 +02:00
parent 51295cd7a2
commit f865612667
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

4
vt.c
View file

@ -697,10 +697,10 @@ action_utf8_print(struct terminal *term, wchar_t wc)
for (size_t i = 0; i < term->composed_count; i++) {
const struct composed *cc = &term->composed[i];
if (cc->count != wanted_count)
if (cc->chars[0] != base)
continue;
if (cc->chars[0] != base)
if (cc->count != wanted_count)
continue;
bool match = true;