mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Update sqratArray.h
Use recently the new squirrel API function.
This commit is contained in:
parent
444b0120ea
commit
ae51c454cc
@ -504,6 +504,22 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reallocates the Array
|
||||
///
|
||||
/// \param newcap Desired capacity of the Array in number of elements
|
||||
///
|
||||
/// \return The Array itself so the call can be chained
|
||||
///
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
ArrayBase& Reserve(const SQInteger newcap) {
|
||||
HSQUIRRELVM vm = SqVM();
|
||||
sq_pushobject(vm, GetObj());
|
||||
sq_arrayreserve(vm, -1, newcap);
|
||||
sq_pop(vm,1); // pop array
|
||||
return *this;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Reverses the elements of the array in place
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user