From ca7b2dfb4b7982d3cf6d235b8f7460fade4928e8 Mon Sep 17 00:00:00 2001 From: Richard Harrington Date: Sun, 12 Oct 2014 11:26:48 -0400 Subject: [PATCH] refactors get-programs using threading operator --- src/robotwar/handler.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/robotwar/handler.clj b/src/robotwar/handler.clj index c449665..b6d54ea 100644 --- a/src/robotwar/handler.clj +++ b/src/robotwar/handler.clj @@ -23,7 +23,10 @@ (defn get-programs "gets a sequence of five programs from the source-code repository." [program-keys] - (take 5 (filter identity (map #(% source-programs/programs) program-keys)))) + (->> program-keys + (map source-programs/programs) + (remove nil?) + (take 5))) (defn add-game "a function to update the games-store atom state.