mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-11-17 04:30:05 +00:00
minor CTable refactoring
This commit is contained in:
@@ -640,7 +640,7 @@ int _tbl__next(CState *state, int nargs, CValue *args)
|
||||
CObjTable *table = (CObjTable *)cosmoV_readRef(val);
|
||||
|
||||
// while the entry is invalid, go to the next entry
|
||||
int cap = table->tbl.capacityMask + 1;
|
||||
int cap = cosmoT_getCapacity(&table->tbl);
|
||||
CTableEntry *entry;
|
||||
do {
|
||||
entry = &table->tbl.table[index++];
|
||||
@@ -1037,7 +1037,9 @@ int cosmoV_execute(CState *state)
|
||||
cosmoV_pop(state); // pop the object from the stack
|
||||
cosmoV_pushValue(state, val);
|
||||
cosmoV_pushRef(state, (CObj *)obj);
|
||||
if (!cosmoV_call(state, 1, 1)) // we expect 1 return value on the stack, the iterable object
|
||||
if (!cosmoV_call(
|
||||
state, 1,
|
||||
1)) // we expect 1 return value on the stack, the iterable object
|
||||
return -1;
|
||||
|
||||
StkPtr iObj = cosmoV_getTop(state, 0);
|
||||
|
||||
Reference in New Issue
Block a user