sminez / ad

an adaptable text editor
https://crates.io/crates/ad-editor
MIT License
243 stars 9 forks source link

GapBuffer: finding range start/end can be done in a single pass #3

Closed sminez closed 2 weeks ago

sminez commented 6 months ago

The current implementation of several GapBuffer methods can be improved by finding the from/to offsets within the buffer in a single pass rather than starting from the beginning of the buffer each time. (This has always been known)