onmyway133 / DeepDiff

🦀Amazingly incredible extraordinary lightning fast diffing in Swift
https://onmyway133.com/apps/
Other
2.05k stars 145 forks source link

Should I implement diifId If object is already conforming Hashable? #63

Open emreond opened 3 years ago

emreond commented 3 years ago

Hello,

Should I implement diifId If object is already conforming Hashable? I am using RealmSwift and my class conforms Object protocol which also conforms Hashable. My problem is that I have an unique string as primary key and that value is used as hashValue. (I don't know how Realm handles it). Therefore, I believe It generates unique int from that string which is used on hash function. When I add below code, I can't be sure If id is unique every time. Therefore, I don't wanna add it.

    var diffId: Int {
        return identifier.hashValue
    }
github-actions[bot] commented 3 years ago

Message that will be displayed on users' first issue