Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

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

Open
emreond opened this issue Apr 23, 2021 · 1 comment
Open

Comments

@emreond
Copy link

emreond commented Apr 23, 2021

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
Copy link

Message that will be displayed on users' first issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant