Skip to content

Instantly share code, notes, and snippets.

@beechtom
Created October 5, 2023 07:37
Show Gist options
  • Save beechtom/eeb180a85e1f911f4eca660f2e51258e to your computer and use it in GitHub Desktop.
Save beechtom/eeb180a85e1f911f4eca660f2e51258e to your computer and use it in GitHub Desktop.
SectionedResults-09
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