@@ -1188,41 +1188,10 @@ _PyDictKeys_StringLookup(PyDictKeysObject* dk, PyObject *key)
1188
1188
return unicodekeys_lookup_unicode (dk , key , hash );
1189
1189
}
1190
1190
1191
-
1192
- #ifdef Py_GIL_DISABLED
1193
-
1194
- // Version of _Py_dict_lookup specialized for when we have split keys and the
1195
- // shared keys are locked.
1196
- static Py_ssize_t
1197
- splitdict_lookup_keys_lock_held (PyDictObject * mp , PyObject * key , Py_hash_t hash ,
1198
- PyObject * * value_addr )
1199
- {
1200
- PyDictKeysObject * dk = mp -> ma_keys ;
1201
- Py_ssize_t ix ;
1202
-
1203
- _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED (mp );
1204
- ASSERT_KEYS_LOCKED (dk );
1205
- assert (PyUnicode_CheckExact (key ));
1206
- assert (dk -> dk_kind == DICT_KEYS_SPLIT );
1207
-
1208
- ix = unicodekeys_lookup_unicode (dk , key , hash );
1209
-
1210
- if (ix >= 0 ) {
1211
- * value_addr = mp -> ma_values -> values [ix ];
1212
- }
1213
- else {
1214
- * value_addr = NULL ;
1215
- }
1216
-
1217
- return ix ;
1218
- }
1219
-
1220
1191
static Py_ssize_t
1221
1192
unicodekeys_lookup_unicode_threadsafe (PyDictKeysObject * dk , PyObject * key ,
1222
1193
Py_hash_t hash );
1223
1194
1224
- #endif // Py_GIL_DISABLED
1225
-
1226
1195
/*
1227
1196
The basic lookup function used by all operations.
1228
1197
This is based on Algorithm D from Knuth Vol. 3, Sec. 6.4.
@@ -1260,15 +1229,16 @@ _Py_dict_lookup(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **valu
1260
1229
ix = unicodekeys_lookup_unicode_threadsafe (dk , key , hash );
1261
1230
if (ix == DKIX_KEY_CHANGED ) {
1262
1231
LOCK_KEYS (dk );
1263
- ix = splitdict_lookup_keys_lock_held (mp , key , hash ,
1264
- value_addr );
1232
+ ix = unicodekeys_lookup_unicode (dk , key , hash );
1265
1233
UNLOCK_KEYS (dk );
1266
- return ix ;
1267
1234
}
1268
1235
}
1269
- #endif
1270
-
1236
+ else {
1237
+ ix = unicodekeys_lookup_unicode (dk , key , hash );
1238
+ }
1239
+ #else
1271
1240
ix = unicodekeys_lookup_unicode (dk , key , hash );
1241
+ #endif
1272
1242
}
1273
1243
else {
1274
1244
INCREF_KEYS_FT (dk );
0 commit comments