projects
/
platform
/
upstream
/
guile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8150823
)
scm_mkstrport: Optimize the POS -> BYTE_POS conversion.
author
Mark H Weaver
<mhw@netris.org>
Tue, 18 Jun 2019 06:09:16 +0000
(
02:09
-0400)
committer
Mark H Weaver
<mhw@netris.org>
Tue, 18 Jun 2019 07:04:41 +0000
(
03:04
-0400)
* libguile/strports.c (scm_mkstrport): Use 'scm_c_string_utf8_length' to
avoid the conversion to UTF-8.
libguile/strports.c
patch
|
blob
|
history
diff --git
a/libguile/strports.c
b/libguile/strports.c
index 876a62a8640572d31bed5886002127d614f68ada..14cdfa06b48f0a085e3918c61f13686984187cee 100644
(file)
--- a/
libguile/strports.c
+++ b/
libguile/strports.c
@@
-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);