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 0054a86 commit 5b6ff8fCopy full SHA for 5b6ff8f
src/java_time/defconversion.clj
@@ -10,9 +10,8 @@
10
vs)
11
12
(defn- to-seq [in]
13
- (if (sequential? in)
14
- in
15
- (vector in)))
+ (cond-> in
+ (not (sequential? in)) vector))
16
17
(defn- wrap-validation [from to f]
18
(fn [vs]
@@ -26,11 +25,11 @@
26
25
(let [res (to-seq (apply f vs))]
27
(subvec res (first combo) (inc (last combo)))))
28
(g/types (subvec xs (first combo) (inc (last combo))))
29
- (if (= (count idxs) (count xs))
30
- cost
+ (cond-> cost
31
;; TODO: mark as lossy conversion
32
;; currently we just incur a 0.5*number of types dropped penalty
33
- (+ cost (* 0.5 (- (count xs) (count combo)))))))))
+ (not= (count idxs) (count xs))
+ (+ (* 0.5 (- (count xs) (count combo)))))))))
34
35
(def ^:dynamic *fail-on-duplicate-conversion?* true)
36
0 commit comments