Skip to content

Commit c4ae700

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

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
@@ -1744,12 +1744,8 @@ insertdict(PyInterpreterState *interp, PyDictObject *mp,
17441744
// to do a threadsafe lookup here. This is basically the split-key
17451745
// half of _Py_dict_lookup_threadsafe and avoids locking the
17461746
// shared keys if we can
1747-
if (PyUnicode_CheckExact(key)) {
1748-
ix = unicodekeys_lookup_unicode_threadsafe(dk, key, hash);
1749-
}
1750-
else {
1751-
ix = unicodekeys_lookup_generic_threadsafe(mp, dk, key, hash);
1752-
}
1747+
assert(PyUnicode_CheckExact(key));
1748+
ix = unicodekeys_lookup_unicode_threadsafe(dk, key, hash);
17531749

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

0 commit comments

Comments
 (0)