From 0cae74d863a1c39740b0b382c3cfa0d9826b826d Mon Sep 17 00:00:00 2001 From: Steve Miner Date: Fri, 23 May 2014 11:28:38 -0400 Subject: [PATCH] Update generators.clj rand-nth would be more efficient if given a vector --- src/clj/joy/generators.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clj/joy/generators.clj b/src/clj/joy/generators.clj index 7a06d92..93244a8 100644 --- a/src/clj/joy/generators.clj +++ b/src/clj/joy/generators.clj @@ -1,6 +1,6 @@ (ns joy.generators) -(def ascii (map char (range 65 (+ 65 26)))) +(def ascii (mapv char (range 65 (+ 65 26)))) (defn rand-str [sz alphabet] (apply str (repeatedly sz #(rand-nth alphabet))))