1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-19 03:57:14 +01:00

Introduce a new constructor into the sqrat Table wrapper which can create a table with an initial capacity.

This commit is contained in:
Sandu Liviu Catalin 2018-07-15 21:31:44 +03:00
parent bfdb042442
commit 13d5a3af3f

View File

@ -535,6 +535,20 @@ public:
Table(HSQOBJECT o, HSQUIRRELVM v = DefaultVM::Get()) : TableBase(o, v) {
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Construct the TableBase with an initial capacity
///
/// \param v VM to create the Table in
/// \param c The initial capacity of the created table
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Table(HSQUIRRELVM v, SQInteger c) : TableBase(v) {
sq_newtableex(vm, c);
sq_getstackobj(vm,-1,&obj);
sq_addref(vm, &obj);
sq_pop(vm,1);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Copy constructor
///