<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 29, 2016, at 4:38 PM, Zhao Xin <<a href="mailto:owenzx@gmail.com" class="">owenzx@gmail.com</a>> wrote:</div>...</blockquote><blockquote type="cite" class=""><div class="gmail_default" style="font-family: Alegreya-Regular;">_ = dict1.map {</div></blockquote><div class=""><div class="gmail_default" style="font-family: Alegreya-Regular;"><br class=""></div></div><div class="gmail_default" style="font-family: Alegreya-Regular;">I just use a `for` loop to iterate dict1, and inside it populate dict2. Using `map` here seems wasteful since it’s building an array that’s thrown away.</div><div class="gmail_default" style="font-family: Alegreya-Regular;"><br class=""></div><blockquote type="cite" class=""><div class=""><div class="gmail_default" style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"> dict2.updateValue(value, forKey:key)</div></div></blockquote></div><br class=""><div class="">This is a tangent, but: Why do you use this syntax instead of the more readable `dict2[key] = value`? (I assume they’re equivalent internally.)</div><div class=""><br class=""></div><div class="">—Jens</div></body></html>