DeepDiff icon indicating copy to clipboard operation
DeepDiff copied to clipboard

Should I implement diifId If object is already conforming Hashable?

Open emreond opened this issue 4 years ago • 1 comments

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
    }

emreond avatar Apr 23 '21 16:04 emreond

Message that will be displayed on users' first issue

github-actions[bot] avatar Apr 23 '21 16:04 github-actions[bot]