Created
October 11, 2017 04:46
-
-
Save ha1f/9987f602cd9fb3345ef24cb4ab1ab9a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension Dictionary { | |
| func duplicated() -> Dictionary<Key, Value> { | |
| return reduce(into: [Key: Value]()) { (dict, item) in | |
| dict[item.key] = item.value | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment