Skip to content

Commit 6c339f4

Browse files
committed
Remove unicode case for set_compare_frozenset.
1 parent 64b17af commit 6c339f4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Objects/setobject.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ set_compare_entry(PySetObject *so, setentry *table, setentry *entry,
164164
}
165165

166166
// This is similar to set_compare_entry() but we don't need to incref startkey
167-
// before comparing and we don't need to check if the set has changed.
167+
// before comparing and we don't need to check if the set has changed. This
168+
// also omits the PyUnicode_CheckExact() special case since it doesn't help
169+
// much for frozensets.
168170
static inline Py_ALWAYS_INLINE int
169171
set_compare_frozenset(PySetObject *so, setentry *table, setentry *ep,
170172
PyObject *key, Py_hash_t hash)
@@ -179,10 +181,6 @@ set_compare_frozenset(PySetObject *so, setentry *table, setentry *ep,
179181
}
180182
Py_ssize_t ep_hash = ep->hash;
181183
if (ep_hash == hash) {
182-
if (PyUnicode_CheckExact(startkey)
183-
&& PyUnicode_CheckExact(key)
184-
&& unicode_eq(startkey, key))
185-
return SET_LOOKKEY_FOUND;
186184
int cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
187185
if (cmp < 0) {
188186
return SET_LOOKKEY_ERROR;

0 commit comments

Comments
 (0)