Skip to content

Commit

Permalink
Add fnil around min to handle nil values for field
Browse files Browse the repository at this point in the history
  • Loading branch information
transducer committed May 8, 2023
1 parent 42d3106 commit 9da11ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Chapter04/Activity4.01/src/packt-clj/game_values.clj
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
(->> users
(filter #(= (:status %) status))
(map field)
(apply min))) ;; do not use a default, (min '()) returns nil
(apply (fnil min 0 0))))

0 comments on commit 9da11ac

Please sign in to comment.