use case instead of condp
This commit is contained in:
parent
ee227d7cd1
commit
ae7d42bd32
1 changed files with 2 additions and 2 deletions
|
|
@ -161,7 +161,7 @@
|
||||||
(to-sql pattern)
|
(to-sql pattern)
|
||||||
(when (seq opts)
|
(when (seq opts)
|
||||||
(str " " (space-join (for [opt opts]
|
(str " " (space-join (for [opt opts]
|
||||||
(condp = opt
|
(case opt
|
||||||
:boolean "IN BOOLEAN MODE"
|
:boolean "IN BOOLEAN MODE"
|
||||||
:natural "IN NATURAL LANGUAGE MODE"
|
:natural "IN NATURAL LANGUAGE MODE"
|
||||||
:expand "WITH QUERY EXPANSION")))))
|
:expand "WITH QUERY EXPANSION")))))
|
||||||
|
|
@ -256,7 +256,7 @@
|
||||||
clojure.lang.Keyword
|
clojure.lang.Keyword
|
||||||
(-to-sql [x]
|
(-to-sql [x]
|
||||||
(let [s (name x)]
|
(let [s (name x)]
|
||||||
(condp = (.charAt s 0)
|
(case (.charAt s 0)
|
||||||
\% (let [call-args (string/split (subs s 1) #"\." 2)]
|
\% (let [call-args (string/split (subs s 1) #"\." 2)]
|
||||||
(to-sql (apply call (map keyword call-args))))
|
(to-sql (apply call (map keyword call-args))))
|
||||||
\? (to-sql (param (keyword (subs s 1))))
|
\? (to-sql (param (keyword (subs s 1))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue