]> git.eshelyaron.com Git - emacs.git/commit
* src/marker.c: Try and speed up byte<->char conversion with many markers.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 26 Mar 2018 13:01:30 +0000 (09:01 -0400)
committerAndrew G Cohen <cohen@andy.bu.edu>
Tue, 11 Dec 2018 06:18:31 +0000 (14:18 +0800)
commit29d2a98366f075ffcc891992e6f2e2fa9d79d085
treeb4c12c474d61a7541be99835dc446e015573ecdd
parentfdbaac529e2be9a81568890eaa4168de42172115
* src/marker.c: Try and speed up byte<->char conversion with many markers.

When considering markers (to find a starting point for the conversion),
typically one of the two bounds is nearby (coming from
cached_(byte|char)pos) but the other is far (point-min or point-max),
so change the exit condition so we stop as soon as *one* of the bounds
is near.

(BYTECHAR_DISTANCE_INITIAL, BYTECHAR_DISTANCE_INCREMENT): New constants.
(buf_charpos_to_bytepos, buf_bytepos_to_charpos): Use them to try and
reduce the number of markers we consider.
src/marker.c