1
0
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:
Sandu Liviu Catalin 2021-01-30 19:40:29 +02:00
parent 444b0120ea
commit ae51c454cc

View File

@ -504,6 +504,22 @@ public:
return *this; 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 /// Reverses the elements of the array in place
/// ///