The Swift standard library copy-on-write collections are built on read
and modify
as an optimization to defend against "accidental quadratics". See this @Ben_Cohen lecture for more background on that.
2 Likes