diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-07-20 16:00:52 -0400 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-07-20 16:00:52 -0400 |
commit | a3de8ac6f5882e60de41bc8b3d11a5581dded0b8 (patch) | |
tree | 7a3c9ff370be54be4d66a60a2da5d4de0923f857 | |
parent | 936705a2dfbe574ac643d166bfb98a1a600b2ff0 (diff) |
prevent vec from creating arrays from Collections
-rw-r--r-- | src/clj/clojure/core.clj | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index ca000810..293adab5 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -251,7 +251,9 @@ (defn vec "Creates a new vector containing the contents of coll." ([coll] - (. clojure.lang.LazilyPersistentVector (createOwning (to-array coll))))) + (if (instance? java.util.Collection coll) + (clojure.lang.LazilyPersistentVector/create coll) + (. clojure.lang.LazilyPersistentVector (createOwning (to-array coll)))))) (defn hash-map "keyval => key val |