Minor refactoring of three dict extensions. I could omit the testAll(_:) refactoring, which now makes use of functional methods rather than explicit classic loops, but at the cost of using negative logic (in two senses), possibly worsening readability. Thoughts?
A related comment:
I might be wrong, but it seems as if the toArray(_:) method duplicates the functionality of the map(:_) method of Dictionary, available via the default implementation from 'Collection'. This fact is quite apparent after the re-factoring of this commit, and possibly prompts discussing a future deprecation of the toArray(_:) method, unless it's deemed valuable as a utility method for pure semantic reasons (however breaking change, so nothing for now).
Swiftlint @ DictionaryExtensions OK (unchanged)
Checklist
[ ] New Extension
[ ] New Test
[ ] Changed more than one extension, but all changes are related
Minor refactoring of three dict extensions. I could omit the
testAll(_:)
refactoring, which now makes use of functional methods rather than explicit classic loops, but at the cost of using negative logic (in two senses), possibly worsening readability. Thoughts?A related comment:
toArray(_:)
method duplicates the functionality of themap(:_)
method of Dictionary, available via the default implementation from 'Collection'. This fact is quite apparent after the re-factoring of this commit, and possibly prompts discussing a future deprecation of thetoArray(_:)
method, unless it's deemed valuable as a utility method for pure semantic reasons (however breaking change, so nothing for now).Swiftlint @ DictionaryExtensions OK (unchanged)
Checklist