aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-11-20 13:32:21 -0500
committerYury Selivanov <yury@magic.io>2018-11-20 14:25:07 -0500
commitd14e5e91fbd88bae54c69b759ee8d76e6569f2c3 (patch)
tree1793dc494ddfdfff5f764d8b5dadfe723d3f05c7
parent50c23b0b66a5f68aa6307ae115a10af40d32e1df (diff)
downloadimmutables-d14e5e91fbd88bae54c69b759ee8d76e6569f2c3.tar.gz
immutables-d14e5e91fbd88bae54c69b759ee8d76e6569f2c3.zip
Fix comment
-rw-r--r--immutables/_map.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/immutables/_map.c b/immutables/_map.c
index 9f57582..652e171 100644
--- a/immutables/_map.c
+++ b/immutables/_map.c
@@ -810,15 +810,17 @@ map_node_bitmap_assoc(MapNode_Bitmap *self,
return (MapNode *)self;
}
- /* We're setting a new value for the key we had before.
- Make a new bitmap node with a replaced value, and return it. */
+ /* We're setting a new value for the key we had before. */
if (mutid != 0 && self->b_mutid == mutid) {
+ /* We've been mutating this node before: update inplace. */
Py_INCREF(val);
Py_SETREF(self->b_array[val_idx], val);
Py_INCREF(self);
return (MapNode *)self;
}
else {
+ /* Make a new bitmap node with a replaced value,
+ and return it. */
MapNode_Bitmap *ret = map_node_bitmap_clone(self, mutid);
if (ret == NULL) {
return NULL;