Skip to content

Commit c55498c

Browse files
committed
MapEntry: switch to case from cond
1 parent eaf67ed commit c55498c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6762,14 +6762,16 @@ reduces them without incurring seq initialization"
67626762

67636763
IIndexed
67646764
(-nth [node n]
6765-
(cond (== n 0) key
6766-
(== n 1) val
6767-
:else (throw (js/Error. "Index out of bounds"))))
6765+
(case n
6766+
0 key
6767+
1 val
6768+
(throw (js/Error. "Index out of bounds"))))
67686769

67696770
(-nth [node n not-found]
6770-
(cond (== n 0) key
6771-
(== n 1) val
6772-
:else not-found))
6771+
(case n
6772+
0 key
6773+
1 val
6774+
not-found))
67736775

67746776
ILookup
67756777
(-lookup [node k] (-nth node k nil))
@@ -6779,7 +6781,10 @@ reduces them without incurring seq initialization"
67796781
(-assoc [node k v]
67806782
(assoc [key val] k v))
67816783
(-contains-key? [node k]
6782-
(or (== k 0) (== k 1)))
6784+
(case k
6785+
0 true
6786+
1 true
6787+
false))
67836788

67846789
IFind
67856790
(-find [node k]

0 commit comments

Comments
 (0)