diff options
author | Blaž Hrastnik | 2022-01-12 01:22:16 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-01-23 07:04:12 +0000 |
commit | 11c3ba935041437d11e1105dfa37480f2d27a6c4 (patch) | |
tree | 4f498a51332cc86910917fd0d84fc91440852c1f /helix-core/src/selection.rs | |
parent | 9d41113ae02665fd73a7e25b4aff9cc416cfe4ae (diff) |
Speed up ensure_next_boundary during render
This code:
let start = ensure_grapheme_boundary_next(text, text.byte_to_char(start));
let end = ensure_grapheme_boundary_next(text, text.byte_to_char(end));
Would convert byte to char index, but then internally immediately convert back
to byte index, operate on it, then convert it to char index.
This change reduces the amount of time spent in ensure_grapheme_boundary from
29% to 2%.
Diffstat (limited to 'helix-core/src/selection.rs')
0 files changed, 0 insertions, 0 deletions