import Foundation import OrderedCollections @inlinable func areOrderedSetsDuplicates(_ lhs: OrderedSet, _ rhs: OrderedSet) -> Bool { guard lhs.count == rhs.count else { return false } return withUnsafePointer(to: lhs) { lhsPointer in withUnsafePointer(to: rhs) { rhsPointer in memcmp(lhsPointer, rhsPointer, MemoryLayout>.size) == 0 || lhs == rhs } } }