|
|
|
|
|
by mikeash
3196 days ago
|
|
What's the use of a non-mutable borrow? Is it just for speed, to avoid copying a large structure? Large structures are rare in Swift and probably not important to optimize. (Value types like String and Array are actually just one reference under the hood, and that's all that gets "copied" when you pass those by value.) |
|
[1]: https://github.com/apple/swift/blob/master/docs/OwnershipMan...