Previously this code had calls to Array.unsafe_set that would use indices beyond the range of the array being manipulated. Thankfully, Zed_string.length would throw an exception first.
Trying to allocate the array in advance does not work out if some Zed_chars are being replaced by an escape sequence with four Zed_chars.
Previously this code had calls to
Array.unsafe_set
that would use indices beyond the range of the array being manipulated. Thankfully,Zed_string.length
would throw an exception first.Trying to allocate the array in advance does not work out if some Zed_chars are being replaced by an escape sequence with four Zed_chars.