use nth instead of get for retrieving first element of vector
This commit is contained in:
parent
39a3755b49
commit
2fe16769ff
1 changed files with 2 additions and 2 deletions
|
|
@ -467,7 +467,7 @@
|
||||||
(extend-protocol UpdateExtremes
|
(extend-protocol UpdateExtremes
|
||||||
#+clj clojure.lang.IPersistentVector #+cljs cljs.core/PersistentVector
|
#+clj clojure.lang.IPersistentVector #+cljs cljs.core/PersistentVector
|
||||||
(update-first [v afn]
|
(update-first [v afn]
|
||||||
(let [val (get v 0)]
|
(let [val (nth v 0)]
|
||||||
(assoc v 0 (afn val))
|
(assoc v 0 (afn val))
|
||||||
))
|
))
|
||||||
(update-last [v afn]
|
(update-last [v afn]
|
||||||
|
|
@ -487,7 +487,7 @@
|
||||||
(extend-protocol GetExtremes
|
(extend-protocol GetExtremes
|
||||||
#+clj clojure.lang.IPersistentVector #+cljs cljs.core/PersistentVector
|
#+clj clojure.lang.IPersistentVector #+cljs cljs.core/PersistentVector
|
||||||
(get-first [v]
|
(get-first [v]
|
||||||
(get v 0))
|
(nth v 0))
|
||||||
(get-last [v]
|
(get-last [v]
|
||||||
(peek v))
|
(peek v))
|
||||||
#+clj Object #+cljs default
|
#+clj Object #+cljs default
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue