Skip to content

Commit a9a1d0c

Browse files
committed
- fix Vector -lookup
1 parent 652cda9 commit a9a1d0c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12311,8 +12311,13 @@ reduces them without incurring seq initialization"
1231112311
not-found))
1231212312

1231312313
ILookup
12314-
(-lookup [coll k] (-nth coll k nil))
12315-
(-lookup [coll k not-found] (-nth coll k not-found))
12314+
(-lookup [coll k]
12315+
(when (number? k)
12316+
(-nth coll k nil)))
12317+
(-lookup [coll k not-found]
12318+
(if (number? k)
12319+
(-nth coll k not-found)
12320+
not-found))
1231612321

1231712322
IAssociative
1231812323
(-assoc [coll k v]

0 commit comments

Comments
 (0)