Clojure

defrecord still uses old hashing algorithm

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.6
  • Fix Version/s: Release 1.6
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Ok

Description

defrecord implements hasheq by calling clojure.lang.APersistentMap/mapHasheq. mapHasheq uses the old map hash calculation instead of the new one. At least one external collection (data.avl) also calls this function. It should be updated to match the new hasheq calculations.

I considered changing defrecord to call Murmur3 directly, but this would create a case where the generated class does not work with older Clojure runtimes so I left it at calling mapHasheq instead.

Patch: clj-1344-1.patch

Activity

Hide
Alex Miller added a comment -

Attached patch to make mapHasheq use new hash map calculation.

Show
Alex Miller added a comment - Attached patch to make mapHasheq use new hash map calculation.
Alex Miller made changes -
Field Original Value New Value
Summary deftype still uses old hashing algorithm defrecord still uses old hashing algorithm
Labels defrecord
Attachment clj-1344-1.patch [ 12769 ]
Description {{deftype}} implements {{hasheq}} by calling {{clojure.lang.APersistentMap/mapHasheq}}. mapHasheq uses the old map hash calculation instead of the new one. At least one external collection (data.avl) also calls this function. It should be updated to match the new hasheq calculations.

{{defrecord}} implements {{hasheq}} by calling {{clojure.lang.APersistentMap/mapHasheq}}. mapHasheq uses the old map hash calculation instead of the new one. At least one external collection (data.avl) also calls this function. It should be updated to match the new hasheq calculations.

I considered changing defrecord to call Murmur3 directly, but this would create a case where the generated class does not work with older Clojure runtimes so I left it at calling mapHasheq instead.

*Patch:* clj-1344-1.patch

Approval Triaged [ 10120 ]
Patch Code [ 10001 ]
Rich Hickey made changes -
Approval Triaged [ 10120 ] Vetted [ 10003 ]
Alex Miller made changes -
Fix Version/s Release 1.6 [ 10157 ]
Stuart Halloway made changes -
Status Open [ 1 ] Closed [ 6 ]
Resolution Completed [ 1 ]
Hide
Alex Miller added a comment -

oops

Show
Alex Miller added a comment - oops
Alex Miller made changes -
Resolution Completed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Approval Vetted [ 10003 ] Screened [ 10004 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Reopened [ 4 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: