[swift-evolution] Dictionary Enhancements

David Sweeris davesweeris at mac.com
Thu Feb 16 19:32:49 CST 2017


> On Feb 16, 2017, at 5:17 PM, Ben Cohen <ben_cohen at apple.com> wrote:
> 
> The win with mapping only the values is that the underlying hash table can retain the same physical layout, just with different values in the slots, so it can be done faster.

Only if the mapped dictionary’s values are the same type (or at least the same size) as in the original dictionary, right? Would the proposed function allow you to mapValues from a [K:V] to a [K:T]?

- Dave Sweeris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170216/56fd7ada/attachment.html>


More information about the swift-evolution mailing list