]> git.eshelyaron.com Git - emacs.git/commit
Avoid expensive recoding for ASCII identity cases (bug#40407)
authorMattias Engdegård <mattiase@acm.org>
Fri, 3 Apr 2020 14:01:01 +0000 (16:01 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sun, 5 Apr 2020 13:37:55 +0000 (15:37 +0200)
commit4ed39549e3f9dbfeb2aea0e2674a7701dbc0e5ea
tree192e8b852c9af4e70ee3ec7a7ca26ae82c57bb2c
parentc7ac76603f291d432586abd2eeb75e1ca6e54863
Avoid expensive recoding for ASCII identity cases (bug#40407)

Optimise for the common case of encoding or decoding an ASCII-only
string using an ASCII-compatible coding, for file names in particular.

* src/coding.c (string_ascii_p): New function.
(code_convert_string): Return the input string for ASCII-only inputs
and ASCII-compatible codings.
* test/src/coding-tests.el (coding-nocopy-ascii): New test.
src/coding.c
test/src/coding-tests.el