diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-06-18 15:53:15 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-06-24 15:30:48 +0000 |
| commit | 81131e3a8757658be264e2069c75406993b8e876 (patch) | |
| tree | 8ddcfcec653d73b5d69f4b84b4d47e91cf0ebc04 /render.c | |
| parent | vt: utf8: de-duplicate; jump to end of function to print to grid (diff) | |
vt: utf8: don’t scan *all* previous chains
When checking if we already have a compose chain for the current
sequence of characters, don’t search the list from the beginning,
unless we have to.
Taking the following things into consideration:
* New compose chains are always appended at the end of the list
* If the current sequence is 3 or more characters, it *must* consist
of an existing compose chain, plus the new character.
Thus, when searching, start at index 0 if we only have two characters,
since then the base cell originally contained a regular base
character, and not a compose chain. I.e. the new chain may be
_anywhere_ in the chain list.
If however we have a sequence of three or more characters, start at
the index the *base* chain was at. If the chain we’re searching for
exists, it *must* have been added *after* the base chain, and thus
it *must* be located *after* the base chain in the chain list.
Diffstat (limited to 'render.c')
0 files changed, 0 insertions, 0 deletions
