Created
October 5, 2023 07:37
-
-
Save beechtom/eeb180a85e1f911f4eca660f2e51258e to your computer and use it in GitHub Desktop.
SectionedResults-09
This file contains 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 Array where Iterator.Element: Hashable { | |
func uniqued() -> [Element] { | |
var seen: Set<Iterator.Element> = [] | |
return filter { seen.insert($0).inserted } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment