Post

Replies

Boosts

Views

Activity

Comment on Need help on Array and API design
Actually I think it's waste of both performance and space. I am aware that when I get a 'copy' of an array in Swift as long as I do not modify it, I actually get a special reference of the array. But when I modify it, the copy-on-write mechanism kicks in and I now get a copy. Later on, I have to replace the original array with the modified array. That's totally against my experience on other languages and systems. But, I know I cannot change anything.
Oct ’23