summaryrefslogtreecommitdiff
path: root/Sora/Extensions/Array+RemovingDuplicates.swift
blob: 15fc697c9741d7dbb5b6b9f4f30590eb7b4aa109 (plain) (blame)
1
2
3
4
5
6
7
8
9
import Foundation

extension Array where Element: Hashable {
  func removingDuplicates() -> [Element] {
    var seen = Set<Element>()

    return filter { seen.insert($0).inserted }
  }
}