-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure transitive property for hash value comparisons #388
Conversation
719f122
to
7078de7
Compare
7078de7
to
466cf0d
Compare
Can you fix it for clj version too? |
Does your test fail without the fix? I was under impression that entities were missing in broken DB, but you are checking that after deleting everything in DB it remains empty. |
Yes, I did verify the test fails before the fix. Verified it again just now for sanity, and that seq is Regarding CLJ support, I imagine it'd look like this:
WDYT? |
|
|
Another problematic case, this one for CLJS
|
Push a change that checks for different classes after the comparable check, but also catches errors and checks for different classes there too. LMK what you think. |
Judging from http://www.docjar.com/html/api/java/lang/Class.java.html, Class toString allocates new string, which is slow. Better use Class.getName, which doesn’t allocate. As for CLJS, I wonder what type result of Otherwise, looks good. Nice touch on try/catch! |
On CLJS For CLJ it does sound better to use get name, will change that. |
Looks good. I’m curious about function comparsion, asked here https://twitter.com/nikitonsky/status/1367984972519313410?s=20. Probably by tomorrow we’ll have an answer, I’ll merge it then. Thanks for the great work and contribution! I’m glad we got to the bottom of this. |
Ok, seems like comparing functions is going through One problem here is that
Another is that in some cases functions return
I think we can go through I’ll add the change and merge the PR now. |
Merged and released 1.0.6. Thanks again! |
Oops, I mean 1.0.7 :) |
I think the end result of this JS behaviour is not a problem, because we only compare types when they are not identical, and identical doesn't seem to suffer from the problem of Which is to say, when we compare we already know they are not identical, and JS may give false positives ("the comparator ret for these two is 0") on the >/< check, but it doesn't give false negatives ("this one is bigger than that one"). Which, as I'm writing this I realise, means it could lead to things not being inserted in the index at all. Not sure what the best thing to do in JS would be here really. But I think these changes are a step forward regardless. |
Fix #386