Question about Script Arrays
really simple question about Script Arrays: When calling resize(), is it smart enough to not do anything if the array is the proper size already? i.e. for array of length 5 does "arr.resize( 5 );" do anything?
Nope. It's something I can easily fix though. Thanks.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Ok, ya I was just wondering if I should do the check my self, but great if you add it to AS as well :)
On that note, when u call resize(). The old elements are copied to the new array right?
On that note, when u call resize(). The old elements are copied to the new array right?
I've already checked in the change.
And yes, when resizing the array, the old elements are copied to the new buffer. And only the extra ones initialized, or those that don't fit destroyed.
You can see more detail in as_arrayobject.cpp.
And yes, when resizing the array, the old elements are copied to the new buffer. And only the extra ones initialized, or those that don't fit destroyed.
You can see more detail in as_arrayobject.cpp.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement