From: Raymond Hettinger Date: Mon, 19 Jan 2015 05:25:15 +0000 (-0800) Subject: A hybrid of and-masking and a conditional-set-to-zero produce even faster search... X-Git-Tag: v3.5.0a1~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed741d4ff0e79c89ba77906eb9417025c3935c71;p=python A hybrid of and-masking and a conditional-set-to-zero produce even faster search loop. --- diff --git a/Objects/setobject.c b/Objects/setobject.c index f865d1c5f9..ddf6822519 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -671,7 +671,8 @@ set_pop(PySetObject *so) while ((entry = &so->table[i])->key == NULL || entry->key==dummy) { i++; - i &= so->mask; + if (i > so->mask) + i = 0; } key = entry->key; entry->key = dummy;