mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
Improved cosmoO_equals performance for strings
This commit is contained in:
parent
c83dca2ab2
commit
55e6453589
@ -107,6 +107,13 @@ bool cosmoO_equal(CState *state, CObj *obj1, CObj *obj2) {
|
|||||||
goto _eqFail;
|
goto _eqFail;
|
||||||
|
|
||||||
switch (obj1->type) {
|
switch (obj1->type) {
|
||||||
|
case COBJ_STRING: {
|
||||||
|
/*
|
||||||
|
we already compared the pointers at the top of the function, this prevents the `__equal` metamethod
|
||||||
|
from being checked. If you plan on using `__equal` with strings just remove this case!
|
||||||
|
*/
|
||||||
|
return false;
|
||||||
|
}
|
||||||
case COBJ_CFUNCTION: {
|
case COBJ_CFUNCTION: {
|
||||||
CObjCFunction *cfunc1 = (CObjCFunction*)obj1;
|
CObjCFunction *cfunc1 = (CObjCFunction*)obj1;
|
||||||
CObjCFunction *cfunc2 = (CObjCFunction*)obj2;
|
CObjCFunction *cfunc2 = (CObjCFunction*)obj2;
|
||||||
|
Loading…
Reference in New Issue
Block a user