Skip to content

Commit 9015a3f

Browse files
committed
Code cleanup, remove unneeded branches.
1 parent 6bf9016 commit 9015a3f

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Objects/dictobject.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,9 +1152,6 @@ unicodekeys_lookup_split(PyDictKeysObject* dk, PyObject *key, Py_hash_t hash)
11521152
ix = unicodekeys_lookup_unicode(dk, key, hash);
11531153
UNLOCK_KEYS(dk);
11541154
}
1155-
else {
1156-
ix = unicodekeys_lookup_unicode(dk, key, hash);
1157-
}
11581155
#else
11591156
ix = unicodekeys_lookup_unicode(dk, key, hash);
11601157
#endif
@@ -7002,12 +6999,7 @@ _PyObject_TryGetInstanceAttribute(PyObject *obj, PyObject *name, PyObject **attr
70026999

70037000
PyDictKeysObject *keys = CACHED_KEYS(Py_TYPE(obj));
70047001
assert(keys != NULL);
7005-
Py_ssize_t ix;
7006-
if (keys->dk_kind == DICT_KEYS_SPLIT) {
7007-
ix = _PyDictKeys_StringLookupSplit(keys, name);
7008-
} else {
7009-
ix = _PyDictKeys_StringLookup(keys, name);
7010-
}
7002+
Py_ssize_t ix = _PyDictKeys_StringLookupSplit(keys, name);
70117003
if (ix == DKIX_EMPTY) {
70127004
*attr = NULL;
70137005
return true;

0 commit comments

Comments
 (0)