Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xiaokang
Copy link
Contributor

This PR is for #245 to fix the default hash code for byte[] and other array in tuple.

@@ -4,5 +4,33 @@

(bootstrap)

(def ARRAY-TYPES-MAP
Copy link
Owner

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 #{}

Copy link
Contributor Author

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.

@nathanmarz
Copy link
Owner

Made a few comments on the code.

@xiaokang
Copy link
Contributor Author

Thanks @nathanmarz 's comments. The first and second is easy to fix but I am not very sure about the third.

@nathanmarz
Copy link
Owner

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.

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

Successfully merging this pull request may close these issues.

2 participants