Skip to content

Commit

Permalink
Remove 'resolve' from ordered set
Browse files Browse the repository at this point in the history
See [clj-commons#71](clj-commons#71).

`clojure.core/hash-unordered-coll` has been around since 1.6 and ordered only
supports 1.8+ so there's no need to check for its existence anymore.
  • Loading branch information
NoahTheDuke committed May 13, 2024
1 parent b531508 commit 7357353
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

* Remove use of `resolve` in ordered-set. [#71](https://github.com/clj-commons/ordered/issues/71)

## 1.15.12 - 2024-05-13

* Fix NPE when hashing ordered-set that contain `nil`.
* Fix NPE when hashing ordered-set that contain `nil`. [#73](https://github.com/clj-commons/ordered/issues/73)

## 1.15.11 - 2023-03-26

Expand Down
9 changes: 1 addition & 8 deletions src/flatland/ordered/set.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@

(declare transient-ordered-set)

;; We could use compile-if technique here, but hoping to avoid
;; an AOT issue using this way instead.
(def hasheq-ordered-set
(or (resolve 'clojure.core/hash-unordered-coll)
(fn old-hasheq-ordered-set [^Seqable s]
(reduce + (map hash (.seq s))))))

(deftype OrderedSet [^clojure.lang.IPersistentMap k->i
^clojure.lang.IPersistentVector i->k]
IPersistentSet
Expand Down Expand Up @@ -66,7 +59,7 @@

IHashEq
(hasheq [this]
(hasheq-ordered-set this))
(hash-unordered-coll this))

Set
(iterator [this]
Expand Down

0 comments on commit 7357353

Please sign in to comment.