This commit is contained in:
blueloveTH 2023-05-20 13:50:12 +08:00
parent d9df9d1e05
commit b97dfe8661

View File

@ -9,7 +9,7 @@
#include "obj.h" #include "obj.h"
#include "str.h" #include "str.h"
#include "tuplelist.h" #include "tuplelist.h"
#include "dict.h" // #include "dict.h"
namespace pkpy{ namespace pkpy{
@ -1445,13 +1445,13 @@ inline void VM::bind__len__(Type type, i64 (*f)(VM*, PyObject*)){
} }
inline void Dict::_probe(PyObject *key, bool &ok, int &i) const{ // inline void Dict::_probe(PyObject *key, bool &ok, int &i) const{
ok = false; // ok = false;
i = vm->hash(key) & _mask; // i = vm->hash(key) & _mask;
while(_items[i].first != nullptr) { // while(_items[i].first != nullptr) {
if(vm->py_equals(_items[i].first, key)) { ok = true; break; } // if(vm->py_equals(_items[i].first, key)) { ok = true; break; }
i = (i + 1) & _mask; // i = (i + 1) & _mask;
} // }
} // }
} // namespace pkpy } // namespace pkpy