Lines Matching defs:new
112 Allocating a new 32-pointers array for every node of our tree would be
216 1. "o.assoc(k, v)" will return a new immutable dictionary, that will be
234 3. "o.without(k)" will return a new immutable dictionary, that will be
298 * W_NEWNODE - the key was found: a new node/tree is returned
306 * I_ITEM - a new item has been yielded;
523 /* Create a new bitmap node of size 'size' */
536 /* No freelist; allocate a new bitmap node */
573 /* Clone a bitmap node; return a new one with the same child notes. */
598 PyHamtNode_Bitmap *new = (PyHamtNode_Bitmap *)hamt_node_bitmap_new(
600 if (new == NULL) {
611 new->b_array[i] = o->b_array[i];
617 new->b_array[i - 2] = o->b_array[i];
620 new->b_bitmap = o->b_bitmap & ~bit;
621 return new;
630 /* Helper method. Creates a new node for key1/val and key2/val2
693 Return: a new node, or self if key/val already is in the
770 /* We're setting a new value for the key we had before.
771 Make a new bitmap node with a replaced value, and return it. */
781 /* It's a new key, and it has the same index as *one* another key.
782 We have a collision. We need to create a new node which will
785 `hamt_node_new_bitmap_or_collision` will either create a new
787 a new Bitmap node.
793 key, val /* new key/val */
832 /* 'jdx' is the index of where the new key should be added
833 in the new Array node we're about to create. */
839 /* Create a new Array node. */
852 /* Make a new bitmap node for the key/val we're adding.
853 Set that bitmap node to new-array-node[jdx]. */
861 node to the new Array node we've just created. */
910 create a new bitmap node out of this node with the
911 new key/val pair added. */
919 /* Allocate new Bitmap node which can have one more key/val
927 /* Copy all keys/values that will be before the new key/value
934 /* Set the new key/value to the new Bitmap node. */
940 /* Copy all keys/values that will be after the new key/value
1262 /* Create a new Collision node. */
1320 /* Set a new key to this level (currently a Collision node)
1332 /* Let's try to lookup the new 'key', maybe we already have it. */
1340 /* This is a totally new key. Clone the current node,
1341 add a new key/value to the cloned node. */
1376 with a new value. Create a new Collision node.*/
1383 /* Copy all elements of the old node to the new one. */
1389 /* Replace the old value with the new value for the our key. */
1401 /* The hash of the new key is different from the hash that
1461 key we're trying to delete. So a new node will be empty
1469 new Collision node would have one. Collision nodes
1499 /* Allocate a new Collision node with capacity for one
1501 PyHamtNode_Collision *new = (PyHamtNode_Collision *)
1504 if (new == NULL) {
1508 /* Copy all other keys from `self` to `new` */
1512 new->c_array[i] = self->c_array[i];
1516 new->c_array[i - 2] = self->c_array[i];
1519 *new_node = (PyHamtNode*)new;
1660 /* Create a new Array node. */
1666 /* Copy all elements from the current Array node to the new one. */
1681 /* Set a new key to this level (currently a Collision node)
1695 /* There's no child node for the given hash. Create a new
1707 creating a new Bitmap node with our key/value pair. */
1716 /* Create a new Array node. */
1724 new one. */
1815 pairs. So we will create a new Array node if we
1820 PyHamtNode_Array *new = hamt_node_array_clone(self);
1821 if (new == NULL) {
1824 new->a_count = new_count;
1825 Py_CLEAR(new->a_array[idx]);
1827 *new_node = (PyHamtNode*)new; /* borrow */
1837 PyHamtNode_Bitmap *new = (PyHamtNode_Bitmap *)
1839 if (new == NULL) {
1865 merge it into the new Bitmap node we're building.
1876 new->b_array[new_i] = key;
1878 new->b_array[new_i + 1] = val;
1881 new->b_array[new_i] = NULL;
1883 new->b_array[new_i + 1] = (PyObject*)node;
1899 /* Just copy the node into our new Bitmap */
1900 new->b_array[new_i] = NULL;
1902 new->b_array[new_i + 1] = (PyObject*)node;
1908 new->b_bitmap = bitmap;
1909 *new_node = (PyHamtNode*)new; /* borrow */
2026 Return a new node, or the same node if key/value already