1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 03:40:56 -08:00

Use cheaper string constructors

* src/coding.c (make_string_from_utf8):
* src/fileio.c (file_name_directory):
* src/lread.c (Fintern):
* src/gnutls.c (Fgnutls_format_certificate):
Use `make_multibyte_string` and `make_unibyte_string` instead of
more expensive `make_specified_string` and `make_string_from_bytes`.
This commit is contained in:
Mattias Engdegård 2024-07-09 10:01:03 +02:00
parent acfc3884bf
commit 7e358aa706
4 changed files with 5 additions and 6 deletions

View file

@ -6365,7 +6365,7 @@ make_string_from_utf8 (const char *text, ptrdiff_t nbytes)
/* If TEXT is a valid UTF-8 string, we can convert it to a Lisp
string directly. Otherwise, we need to decode it. */
if (chars == nbytes || bytes == nbytes)
return make_specified_string (text, chars, nbytes, true);
return make_multibyte_string (text, chars, nbytes);
else
{
struct coding_system coding;