]> git.eshelyaron.com Git - emacs.git/commit
Fix slow operation of 'string-width'
authorEli Zaretskii <eliz@gnu.org>
Sat, 5 Jun 2021 11:16:06 +0000 (14:16 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 5 Jun 2021 11:16:06 +0000 (14:16 +0300)
commitf93f3b80dde20a0c643b011d1bf78e34860870a2
tree6ac3c66e9637faee69c4600682a5a1d46273149d
parent3eb294745cb0ce3a312d95f848bd63cab75b23d5
Fix slow operation of 'string-width'

* src/composite.c (find_automatic_composition): Accept one
additional argument BACKLIM; don't look back in buffer or string
farther than that.  Add an assertion for BACKLIM.
(composition_adjust_point, Ffind_composition_internal): Callers
adjusted.
* src/composite.h (find_automatic_composition): Adjust prototype.
* src/character.c (lisp_string_width): Call
'find_automatic_composition' with the value of BACKLIM equal to POS,
to avoid costly and unnecessary search back in the string, since
those previous characters were already checked for automatic
compositions.  (Bug#48734)  (Bug#48839)
src/character.c
src/composite.c
src/composite.h