mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
fix dict compare
This commit is contained in:
parent
6e780173f9
commit
21fdaeaa21
@ -1496,7 +1496,9 @@ void __init_builtins(VM* _vm) {
|
|||||||
pkpy_DictIter it = self.iter();
|
pkpy_DictIter it = self.iter();
|
||||||
PyVar key, val;
|
PyVar key, val;
|
||||||
while(pkpy_DictIter__next(&it, reinterpret_cast<::pkpy_Var*>(&key), reinterpret_cast<::pkpy_Var*>(&val))) {
|
while(pkpy_DictIter__next(&it, reinterpret_cast<::pkpy_Var*>(&key), reinterpret_cast<::pkpy_Var*>(&val))) {
|
||||||
if(!vm->py_eq(val, other.try_get(vm, key))) return vm->False;
|
PyVar other_val = other.try_get(vm, key);
|
||||||
|
if(other_val == nullptr) return vm->False;
|
||||||
|
if(!vm->py_eq(val, other_val)) return vm->False;
|
||||||
}
|
}
|
||||||
return vm->True;
|
return vm->True;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user