From 18e2b06732a8772701fa4e0452ceb0cf9d788128 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 21 May 2023 20:06:37 +0900 Subject: [PATCH] Remove duplicated lookup from unicodekeys_lookup_unicode --- Objects/dictobject.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 7436c113f37c4a..fef8345df3bdb7 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -944,21 +944,6 @@ unicodekeys_lookup_unicode(PyDictKeysObject* dk, PyObject *key, Py_hash_t hash) } perturb >>= PERTURB_SHIFT; i = mask & (i*5 + perturb + 1); - ix = dictkeys_get_index(dk, i); - if (ix >= 0) { - PyDictUnicodeEntry *ep = &ep0[ix]; - assert(ep->me_key != NULL); - assert(PyUnicode_CheckExact(ep->me_key)); - if (ep->me_key == key || - (unicode_get_hash(ep->me_key) == hash && unicode_eq(ep->me_key, key))) { - return ix; - } - } - else if (ix == DKIX_EMPTY) { - return DKIX_EMPTY; - } - perturb >>= PERTURB_SHIFT; - i = mask & (i*5 + perturb + 1); } Py_UNREACHABLE(); }