]> git.eshelyaron.com Git - emacs.git/commit
Speed up count_size_as_multibyte
authorMattias Engdegård <mattiase@acm.org>
Wed, 16 Feb 2022 11:27:59 +0000 (12:27 +0100)
committerMattias Engdegård <mattiase@acm.org>
Wed, 16 Feb 2022 11:33:35 +0000 (12:33 +0100)
commit3b7d55a8013914b6707211d148a6e878ca118ad9
tree64315cbcdb9b654c1ccb4a2397000c52b1644384
parentbc84c31823e424827a27dc2eb1b5cbee040036cf
Speed up count_size_as_multibyte

This function is used in many places to calculate the length of
a unibyte string converted to multibyte.

* src/character.c (count_size_as_multibyte): Move the overflow test
outside the loop, which makes it much faster.  Standard compilers
will even vectorise it if asked to (-O2 in Clang, -O3 in GCC).
src/character.c