Closed dahaihu closed 3 years ago
What is the meaning of copyOnWriteContext ? Only when tree is created, the only one copyOnWriteContext is initiated. There is no other time that create a newcopyOnWriteContext. In function mutableFor, the n.cow always equals cow.
copyOnWriteContext
mutableFor
n.cow
cow
I found the use of copyOnWriteContext. When a tree is cloned, the unmodified node shares the same view of tree with the original tree.
What is the meaning of
copyOnWriteContext
?Only when tree is created, the only one
copyOnWriteContext
is initiated. There is no other time that create a newcopyOnWriteContext
.In function
mutableFor
, then.cow
always equalscow
.