mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
scm_mkstrport: Optimize the POS -> BYTE_POS conversion.
* libguile/strports.c (scm_mkstrport): Use 'scm_c_string_utf8_length' to avoid the conversion to UTF-8.
This commit is contained in:
parent
8150823fc8
commit
9f7a824206
1 changed files with 2 additions and 2 deletions
|
@ -195,8 +195,8 @@ scm_mkstrport (SCM pos, SCM str, long modes, const char *caller)
|
|||
else
|
||||
/* Inefficient but simple way to convert the character position
|
||||
POS into a byte position BYTE_POS. */
|
||||
free (scm_to_utf8_stringn (scm_substring (str, SCM_INUM0, pos),
|
||||
&byte_pos));
|
||||
byte_pos = scm_c_string_utf8_length
|
||||
(scm_substring (str, SCM_INUM0, pos));
|
||||
}
|
||||
|
||||
stream = scm_gc_typed_calloc (struct string_port);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue