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:
parent
bfdb042442
commit
13d5a3af3f
@ -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
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user