阅读背景:

在Swift中以字节数定义数组容量

来源:互联网 

A program I am working on is doing some string manipulation in which the output array containing the words will be the same or smaller than the input array. For example, the input array contains 100 elements, each element is one word (varrying length). After manipulation, there were only be 99 elements. Let's say the input array is 500 bytes. Can I tell Swift to make sure the output array is at least 500 bytes long so that when adding elements it doesn't need to move them to a different part of memory with more room for elements multiple times?A program I am working on is doing some string




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: