mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
15 lines
400 B
Swift
15 lines
400 B
Swift
import Foundation
|
|
import OrderedCollections
|
|
|
|
@inlinable
|
|
func areOrderedSetsDuplicates<T>(_ lhs: OrderedSet<T>, _ rhs: OrderedSet<T>) -> Bool {
|
|
guard lhs.count == rhs.count
|
|
else { return false }
|
|
|
|
return withUnsafePointer(to: lhs) { lhsPointer in
|
|
withUnsafePointer(to: rhs) { rhsPointer in
|
|
memcmp(lhsPointer, rhsPointer, MemoryLayout<OrderedSet<T>>.size) == 0 || lhs == rhs
|
|
}
|
|
}
|
|
}
|