mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-06-24 10:30:02 +00:00
Refactored cosmoO_equals
This sets up room for the '__equal' metamethod to be added - cosmoO_equals now requires the state to be passed - cosmoV_equals now requires the state to be passed - cosmoT_get now requires the state to be passed
This commit is contained in:
@@ -39,7 +39,7 @@ void freeChunk(CState* state, CChunk *chunk) {
|
||||
int addConstant(CState* state, CChunk *chunk, CValue value) {
|
||||
// before adding the constant, check if we already have it
|
||||
for (size_t i = 0; i < chunk->constants.count; i++) {
|
||||
if (cosmoV_equal(value, chunk->constants.values[i]))
|
||||
if (cosmoV_equal(state, value, chunk->constants.values[i]))
|
||||
return i; // we already have a matching constant!
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user