Commits

Meikel Brandmeyer  committed eb5f6d6

Also check vector on key access

  • Participants
  • Parent commits 904e8d8
  • Branches new

Comments (0)

Files changed (1)

File src/main/clojure/de/kotka/lazymap.clj

   (get-key       [#^IMapEntry this] (.getKey this))
   (get-raw-value [#^IMapEntry this] (let [v (.getValue this)] (delay v)))
   IPersistentVector
-  (get-key [this] (this 0))
+  (get-key [this]
+    (when-not (= (count this) 2)
+      (throw (IllegalArgumentException.
+               "Vector used as IMapEntry must be a pair")))
+    (this 0))
   (get-raw-value
     [this]
     (when-not (= (count this) 2)