Skip to content

CLJS-3324: hash-map behavior differs from Clojure #102

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

Merged
merged 2 commits into from
Aug 26, 2021
Merged

Conversation

swannodette
Copy link
Member

Add runtime check to hash-map w/o changing perf.

Add runtime check to PersistentHashMap.fromArrays w/o significant perf change.

hash-map is also an inlining macro which invokes PersistentHashMap.fromArrays.
naive use of partition leads to garbage in / out. Pad to fill in the missing value,
then remove - then when computing the values drop when we hit a non-pair. This way
we get non-matching array lengths and can defer to the runtime check.

Add tests.

Add runtime check to hash-map w/o changing perf.

Add runtime check to PersistentHashMap.fromArrays w/o significant perf change.

hash-map is also an inlining macro which invokes PersistentHashMap.fromArrays.
naive use of partition leads to garbage in / out. Pad to fill in the missing value,
then remove - then when computing the values drop when we hit a non-pair. This way
we get non-matching array lengths and can defer to the runtime check.

Add tests.
@swannodette swannodette merged commit 5590b8d into master Aug 26, 2021
@swannodette swannodette deleted the cljs-3324 branch September 2, 2021 16:10
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.

1 participant