保留原著,并且问题被回答或审核通过时通知你:
每次Vector大小增加时,都将分配一个新的内存块。Vector的当前内容会复制到新内存块中。这种额外的分配和复制数据会降低性能。所以,尽量在创建Vector对象时,能将长度设为固定值就设为固定值。
- 作者:SWFAQ | http://swfaq.org/
Your email is never shared. Required fields are marked *
Anti-spam word: (Required)* To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.