array-map and hash-map differ in handling of keys comparing identical but not equal

Description

user=> (let [a (array-map Double/NaN 1)] (assoc a (key (first a)) "foo")) {NaN 1, NaN "foo"} user=> (let [a (hash-map Double/NaN 1)] (assoc a (key (first a)) "foo")) {NaN "foo"}

Approach: Array-map's comparison skips identity-check and always delegates to .equals calls. The attached patch alignes array-map behaviour with hash-map by doing the appropriate pointer checks before delegating to .equals

Environment

None

Attachments

1
  • 04 Aug 2015, 11:09 PM

Activity

Show:

Details

Assignee

Reporter

Patch

Code

Priority

Created August 4, 2015 at 11:09 PM
Updated August 4, 2015 at 11:09 PM

Flag notifications