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