Skip to content

Commit

Permalink
memoize aall the calls (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCrotti authored Jan 8, 2020
1 parent c9d5947 commit bab0322
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cljc/byf/rankings.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
[(apply min (map :ranking full-rankings-history))
(apply max (map :ranking full-rankings-history))]))

(defn rankings
(defn rankings*
[games players up-to-games dead-players game-config]
(let [rankings
(games/get-rankings (truncate-games games up-to-games)
Expand All @@ -38,6 +38,8 @@

(sort-by #(- (:ranking %)) updated)))

(def rankings (memoize rankings*))

(defn last-ranking-changes
[rankings-history last-games-played-by]
(medley/map-vals
Expand Down

0 comments on commit bab0322

Please sign in to comment.