Set's contains method returns different value at different time
问题 I was thinking about how Swift ensures uniqueness for Set because I have turned one of my obj from Equatable to Hashable for free and so I came up with this simple Playground struct SimpleStruct: Hashable { let string: String let number: Int static func == (lhs: SimpleStruct, rhs: SimpleStruct) -> Bool { let areEqual = lhs.string == rhs.string print(lhs, rhs, areEqual) return areEqual } } var set = Set<SimpleStruct>() let first = SimpleStruct(string: "a", number: 2) set.insert(first) So my