fix(perf): bind length/1 to variables before loop bodies in route paths and sidebar (CSM-029)

This commit is contained in:
hugo committed 2026-05-11 20:18:56 +02:00
1 parent 2632649cdc
commit 4a089b0856
4 files changed
+79 -10

No files matched your search

+3 -1
View File
@@ -821,11 +821,13 @@ defmodule BDS.UI.Sidebar do
# ---------------------------------------------------------------------------
defp build_post_section(title, status, posts, translation_counts, published_meta?) do
post_count = length(posts)
%{
id: Atom.to_string(status),
title: title,
status: Atom.to_string(status),
count: length(posts),
count: post_count,
items:
Enum.map(posts, fn post ->
%{