From 977ab9ea3a59e24b985aa41cd170d542951f7ca8 Mon Sep 17 00:00:00 2001 From: Sebastian Crane Date: Mon, 3 Jan 2022 20:37:34 +0000 Subject: [PATCH] Ensure that add-player-of-game function is idempotent Signed-off-by: Sebastian Crane --- src/game.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game.clj b/src/game.clj index 5d21e82..98a4187 100644 --- a/src/game.clj +++ b/src/game.clj @@ -7,7 +7,7 @@ (get-in state [:games game])) (defn add-player-of-game [state game player] - (update-in state [:games game] #(conj % player))) + (update-in state [:games game] #(set (conj % player)))) (defn remove-player-of-game [state game player] (update-in state [:games game] #(disj % player)))