performance increases
memoize construction of ranges, and use transient/mutable Java collections for internal collection state
This commit is contained in:
@@ -31,10 +31,12 @@
|
||||
(toString [_this]
|
||||
(str start ".." end)))
|
||||
|
||||
(defn int-range-inclusive [start end]
|
||||
(defn- int-range-inclusive* [start end]
|
||||
(assert (<= start end) (str "start : " start "; end: " end))
|
||||
(->IntInclusiveDiscreteValueRange start end))
|
||||
|
||||
(def int-range-inclusive (memoize int-range-inclusive*))
|
||||
|
||||
(defmethod range/->discrete-value-range :int-range-inclusive [_ start end]
|
||||
(int-range-inclusive start end))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user