mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
Faster scm_from_port_stringn
* libguile/strings.c (scm_from_port_stringn): Always inline to scm_from_utf8_string if the byte sequence is valid utf-8.
This commit is contained in:
parent
be7ecef05c
commit
25752c4d1c
1 changed files with 2 additions and 1 deletions
|
@ -1740,7 +1740,8 @@ scm_from_port_stringn (const char *str, size_t len, SCM port)
|
|||
if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_LATIN1)
|
||||
return scm_from_latin1_stringn (str, len);
|
||||
else if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8
|
||||
&& pt->ilseq_handler == SCM_FAILED_CONVERSION_ERROR)
|
||||
&& (pt->ilseq_handler == SCM_FAILED_CONVERSION_ERROR
|
||||
|| (u8_check ((uint8_t *) str, len) == NULL)))
|
||||
return scm_from_utf8_stringn (str, len);
|
||||
else
|
||||
return scm_from_stringn (str, len, pt->encoding, pt->ilseq_handler);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue