Skip to content

Commit ceda235

Browse files
committed
Assert we always have unicode only key in split dict case
1 parent f3377ee commit ceda235

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,12 +1755,8 @@ insertdict(PyInterpreterState *interp, PyDictObject *mp,
17551755
// to do a threadsafe lookup here. This is basically the split-key
17561756
// half of _Py_dict_lookup_threadsafe and avoids locking the
17571757
// shared keys if we can
1758-
if (PyUnicode_CheckExact(key)) {
1759-
ix = unicodekeys_lookup_unicode_threadsafe(dk, key, hash);
1760-
}
1761-
else {
1762-
ix = unicodekeys_lookup_generic_threadsafe(mp, dk, key, hash);
1763-
}
1758+
assert(PyUnicode_CheckExact(key));
1759+
ix = unicodekeys_lookup_unicode_threadsafe(dk, key, hash);
17641760

17651761
if (ix >= 0) {
17661762
old_value = mp->ma_values->values[ix];

0 commit comments

Comments
 (0)