]> git.eshelyaron.com Git - emacs.git/commit
Faster NSString to Lisp string conversion
authorMattias Engdegård <mattiase@acm.org>
Wed, 9 Aug 2023 10:34:06 +0000 (12:34 +0200)
committerMattias Engdegård <mattiase@acm.org>
Wed, 9 Aug 2023 11:02:00 +0000 (13:02 +0200)
commit722b1ebc6e0ca23c018d5264e5c70b8f37bd9150
treeb54edd66beefde53d55941d57467779eceee447d
parent08cc48e496ed98f16a014bf7ced69f527b72ab11
Faster NSString to Lisp string conversion

Since we know that the value from [NSString UTF8String] is valid
UTF-8, using make_string is wastefully slow.

* src/nsfns.m (count_utf8_chars): New function, at least twice as fast
as parse_str_as_multibyte used by make_string for this purpose.
([NSString lispString]): Use count_utf8_chars.  We now always make a
multibyte string because there is no reason not to.
src/nsfns.m