JLChen
2021-10-28 5f1cb537d1861842ed9213aaa29823d5b828e283
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//
//  Copyright © 2019 dahua. All rights reserved.
//
 
import Foundation
 
public extension Array where Element: Hashable {
    var unique: [Element] {
        var uniq = Set<Element>()
        uniq.reserveCapacity(self.count)
        return self.filter {
            return uniq.insert($0).inserted
        }
    }
}