public ShaMapLeaf InvalidatedPossiblyCopiedLeafForUpdating() { Debug.Assert(_matched); if (_dirtied == null) { DirtyOrCopyInners(); } var theLeaf = Leaf; if (CopyLeafOnUpdate()) { theLeaf = Leaf.Copy(); Top().SetLeaf(theLeaf); } theLeaf.Invalidate(); return(theLeaf); }