Correct string equality check
This commit is contained in:
parent
b443a54822
commit
b5648963a7
|
@ -242,7 +242,7 @@ Object _basicOp(const Object *obj1, const Object *obj2, const char op,
|
||||||
return numberObject(n1 % n2);
|
return numberObject(n1 % n2);
|
||||||
|
|
||||||
case '=':
|
case '=':
|
||||||
if(obj1->type == TYPE_STRING || obj2->type == TYPE_STRING)
|
if(obj1->type == TYPE_STRING && obj2->type == TYPE_STRING)
|
||||||
return boolObject(!strcmp(obj1->string, obj2->string));
|
return boolObject(!strcmp(obj1->string, obj2->string));
|
||||||
if(obj1->type == TYPE_LIST && obj2->type == TYPE_LIST)
|
if(obj1->type == TYPE_LIST && obj2->type == TYPE_LIST)
|
||||||
return listEquality(obj1, obj2);
|
return listEquality(obj1, obj2);
|
||||||
|
|
Loading…
Reference in New Issue