swift
3ef6ec5f - Don't double allocate when making a foreign string native

Commit
2 years ago
Don't double allocate when making a foreign string native Converting a string with non-contiguous-UTF-8 storage to a native Swift string performs a double allocation: once to fill an array with the UTF-8 data, and then again for the new string itself. This change removes the intermediate array, directly allocating the new string and then copying the UTF-8 into that new buffer.
Author
Parents
Loading