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

This commit is contained in:
2026-05-11 20:18:56 +02:00
parent 2632649cdc
commit 4a089b0856
4 changed files with 79 additions and 10 deletions

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 ->
%{