mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
The spelling list converted each misspelling's start and end byte offset to a character offset with char_at, which recounts the text prefix from the start every call. A layer with many short misspellings therefore caused quadratic rescanning on the synchronous UI thread. Collect the ascending offsets and map them to character offsets in a single forward walk over the text. char_at is removed (byte_at still handles the reverse direction in change()). Finding: 392eb136-b836-4400-8ed7-f1e4549ff0ae (CWE-407)