We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f68e1c commit ca5e288Copy full SHA for ca5e288
src/java_time/single_field.cljc
@@ -22,8 +22,8 @@
22
(defn- get-only-unit-value ^long [^TemporalAmount a, ^TemporalUnit u]
23
(let [non-zero-units
24
(->> (.getUnits a)
25
- (map (fn [^TemporalUnit tu] (vector tu (.get a tu))))
26
- (filter (fn [[_ uv]] (not (zero? uv)))))
+ (map (fn [^TemporalUnit tu] [tu (.get a tu)]))
+ (remove (fn [[_ uv]] (zero? uv))))
27
[our-unit our-value] (first (filter (fn [[tu]] (= tu u)) non-zero-units))]
28
(when-not our-unit
29
(let [msg (format "No unit: %s found in %s!" u a)]
0 commit comments