io.encodings: slight performance improvement to byte-array>string-fast.

db4
John Benediktsson 2013-11-24 20:04:15 -08:00
parent 473fdc0d84
commit 30f450d21a
1 changed files with 6 additions and 6 deletions

View File

@ -53,13 +53,13 @@ CONSTANT: replacement-char 0xfffd
{ byte-array } declare
[ length ] keep over 0 <string> [
[
[ [ nth-unsafe ] 2keep drop ]
[
[
nth-unsafe dup 127 <=
[ drop replacement-char ] unless
] 2keep drop
]
[ set-string-nth ] bi*
pick 127 <=
[ set-string-nth-fast ]
[ [ drop replacement-char ] 2dip set-string-nth-slow ]
if
] bi*
] 2curry each-integer
] keep dup reset-string-hashcode ;