@@ -386,18 +386,14 @@ _Py_Specialize_LoadGlobal(
386
386
_PyAdaptiveEntry * cache0 = & cache -> adaptive ;
387
387
_PyLoadGlobalCache * cache1 = & cache [-1 ].load_global ;
388
388
assert (PyUnicode_CheckExact (name ));
389
- Py_hash_t hash = PyObject_Hash (name );
390
- if (hash == -1 ) {
391
- return -1 ;
392
- }
393
389
if (!PyDict_CheckExact (globals )) {
394
390
goto fail ;
395
391
}
396
- if (((PyDictObject * )globals )-> ma_keys -> dk_kind == DICT_KEYS_SPLIT ) {
392
+ if (((PyDictObject * )globals )-> ma_keys -> dk_kind != DICT_KEYS_UNICODE ) {
397
393
goto fail ;
398
394
}
399
- PyObject * value ;
400
- Py_ssize_t index = _Py_dict_lookup ((PyDictObject * )globals , name , hash , & value );
395
+ PyObject * value = NULL ;
396
+ Py_ssize_t index = _PyDict_GetItemHint ((PyDictObject * )globals , name , -1 , & value );
401
397
assert (index != DKIX_ERROR );
402
398
if (index != DKIX_EMPTY ) {
403
399
if (index != (uint16_t )index ) {
@@ -415,10 +411,10 @@ _Py_Specialize_LoadGlobal(
415
411
if (!PyDict_CheckExact (builtins )) {
416
412
goto fail ;
417
413
}
418
- if (((PyDictObject * )builtins )-> ma_keys -> dk_kind == DICT_KEYS_SPLIT ) {
414
+ if (((PyDictObject * )builtins )-> ma_keys -> dk_kind != DICT_KEYS_UNICODE ) {
419
415
goto fail ;
420
416
}
421
- index = _Py_dict_lookup ((PyDictObject * )builtins , name , hash , & value );
417
+ index = _PyDict_GetItemHint ((PyDictObject * )builtins , name , -1 , & value );
422
418
assert (index != DKIX_ERROR );
423
419
if (index != (uint16_t )index ) {
424
420
goto fail ;
0 commit comments