> On Aug 24, 2016, at 7:07 AM, Jean-Denis Muys via swift-users 
> <[email protected]> wrote:
> 
> However I was wondering if it was possible (preferable?) to do it in a more 
> “functional” style.

Apple’s Foundation framework has Array.arrayByAddingObject (but not ByRemoving).

However, this would not be preferable (at least in performance) due to all the 
copying. Performance of appending n items would be O(n^2), for instance, vs. 
O(n) for appending in-place.

—Jens
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to