Use sum_by instead of plain reduce

Makes it for slightly simpler code.
This commit is contained in:
Claudio Ortolina
2024-12-28 13:37:45 +00:00
parent 77141fbfaf
commit 17d1a87f3c
@@ -73,7 +73,7 @@ defmodule MusicLibraryWeb.StatsLive.Index do
collection_count_by_type = Collection.count_records_by_type()
collection_count =
Enum.reduce(collection_count_by_format, 0, fn {_, count}, acc -> acc + count end)
Enum.sum_by(collection_count_by_format, fn {_, count} -> count end)
wishlist_count = Wishlist.count()