]> granicus.if.org Git - python/commitdiff
Add assertion to verify the pre-condition in the comments.
authorRaymond Hettinger <python@rcn.com>
Wed, 18 Nov 2015 04:58:43 +0000 (20:58 -0800)
committerRaymond Hettinger <python@rcn.com>
Wed, 18 Nov 2015 04:58:43 +0000 (20:58 -0800)
Objects/setobject.c

index 083cbea412f5d3817b41c424bf3b06be55a2f989..7fde01f5999cc58894da34fd72d2f2fc8712b0de 100644 (file)
@@ -269,6 +269,7 @@ set_insert_clean(PySetObject *so, PyObject *key, Py_hash_t hash)
     size_t i = (size_t)hash & mask;
     size_t j;
 
+    assert(so->fill == so->used);
     while (1) {
         entry = &table[i];
         if (entry->key == NULL)