<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">That’s going to be quite slow, like O(n^2), since it copies the dictionary every time it adds a key to it.<div class="">It also seems more complicated than the simple for-loop implementation; but then, I’m not a functional-language programmer.<br class=""><div class=""><br class=""></div><div class="">// here’s how I’d do it; not tested in a playground</div><div class="">var dict2 = [Key:Value](minCapacity: dict1.count)</div><div class="">for (k,v) in dict1 {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>let&nbsp;(k1,v1) = <i class="">xform</i>(k,v)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>dict2[k1] = v1</div><div class="">}</div><div class=""><br class=""></div><div class="">—Jens</div></div></body></html>