Ensure that add-player-of-game function is idempotent

Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
Sebastian Crane 2022-01-03 20:37:34 +00:00
parent 6e0f0237b3
commit 977ab9ea3a
1 changed files with 1 additions and 1 deletions

View File

@ -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)))