Author rhettinger
Recipients christian.heimes, rhettinger, serhiy.storchaka, vstinner
Date 2013-08-17.23:08:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376780920.98.0.616505973936.issue18771@psf.upfronthosting.co.za>
In-reply-to
Content
Here's an excerpt from the patch that gives a pretty good idea of what is being changed (the three lines of new logic are marked):

static void
set_insert_clean(PySetObject *so, PyObject *key, Py_hash_t hash)
{
    setentry *table = so->table;
    setentry *entry;
    size_t perturb = hash;
    size_t mask = (size_t)so->mask;
    size_t i, j;                        // the j variable is new
    i = j = (size_t)hash & mask;
    while(1) {
        entry = &table[j];
        if (entry->key == NULL)
            break;
        entry = &table[j ^ 1];          // this line is new
        if (entry->key == NULL)         // this line is new
            break;                      // this line new
        i = i * 5 + perturb + 1;
        j = i & mask;
        perturb >>= PERTURB_SHIFT;
    }
    so->fill++;
    entry->key = key;
    entry->hash = hash;
    so->used++;
}
History
Date User Action Args
2013-08-17 23:08:41rhettingersetrecipients: + rhettinger, vstinner, christian.heimes, serhiy.storchaka
2013-08-17 23:08:40rhettingersetmessageid: <1376780920.98.0.616505973936.issue18771@psf.upfronthosting.co.za>
2013-08-17 23:08:40rhettingerlinkissue18771 messages
2013-08-17 23:08:40rhettingercreate