diff --git a/Objects/setobject.c b/Objects/setobject.c --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -171,12 +171,12 @@ Py_INCREF(startkey); cmp = PyObject_RichCompareBool(startkey, key, Py_EQ); Py_DECREF(startkey); + if (cmp > 0) /* likely */ + goto found_active; if (cmp < 0) /* unlikely */ goto comparison_error; if (table != so->table || entry->key != startkey) /* unlikely */ goto restart; - if (cmp > 0) /* likely */ - goto found_active; mask = so->mask; /* help avoid a register spill */ } else if (entry->hash == -1 && freeslot == NULL) @@ -200,12 +200,12 @@ Py_INCREF(startkey); cmp = PyObject_RichCompareBool(startkey, key, Py_EQ); Py_DECREF(startkey); + if (cmp > 0) + goto found_active; if (cmp < 0) goto comparison_error; if (table != so->table || entry->key != startkey) goto restart; - if (cmp > 0) - goto found_active; mask = so->mask; } else if (entry->hash == -1 && freeslot == NULL)