-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
deep hash code for byte[] and other array in tuple #746
base: master
Are you sure you want to change the base?
Conversation
@@ -4,5 +4,33 @@ | |||
|
|||
(bootstrap) | |||
|
|||
(def ARRAY-TYPES-MAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a set. The syntax is #{}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It should be a set instead of map. It's due to my mis-understanding that contains? only work with map.
Made a few comments on the code. |
Thanks @nathanmarz 's comments. The first and second is easy to fix but I am not very sure about the third. |
I believe it will still box and unbox even when you use unchecked-add-int because it's wrapped in a function passed to reduce. I think it's worth trying to write that code in Java and see how the performance compares to the pure Clojure version. Alternatively, you can manually do a loop on the list – I believe Clojure will not box the bindings on the loop between iterations. |
This PR is for #245 to fix the default hash code for byte[] and other array in tuple.