io.encodings: slight performance improvement to byte-array>string-fast.
parent
473fdc0d84
commit
30f450d21a
|
@ -53,13 +53,13 @@ CONSTANT: replacement-char 0xfffd
|
||||||
{ byte-array } declare
|
{ byte-array } declare
|
||||||
[ length ] keep over 0 <string> [
|
[ length ] keep over 0 <string> [
|
||||||
[
|
[
|
||||||
|
[ [ nth-unsafe ] 2keep drop ]
|
||||||
[
|
[
|
||||||
[
|
pick 127 <=
|
||||||
nth-unsafe dup 127 <=
|
[ set-string-nth-fast ]
|
||||||
[ drop replacement-char ] unless
|
[ [ drop replacement-char ] 2dip set-string-nth-slow ]
|
||||||
] 2keep drop
|
if
|
||||||
]
|
] bi*
|
||||||
[ set-string-nth ] bi*
|
|
||||||
] 2curry each-integer
|
] 2curry each-integer
|
||||||
] keep dup reset-string-hashcode ;
|
] keep dup reset-string-hashcode ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue