From e6ff6f57e701710f0b7ad4dbcf41d505c9a40101 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 1 Feb 2026 21:35:36 +0100 Subject: [PATCH] comp --- esphome/analyze_memory/cli.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/esphome/analyze_memory/cli.py b/esphome/analyze_memory/cli.py index 549fc16d44..15c3a64f97 100644 --- a/esphome/analyze_memory/cli.py +++ b/esphome/analyze_memory/cli.py @@ -154,13 +154,12 @@ class MemoryAnalyzerCLI(MemoryAnalyzer): def _add_top_symbols(self, lines: list[str]) -> None: """Add a section showing the top largest symbols in the binary.""" - # Collect all symbols from all components - all_symbols: list[ - tuple[str, str, int, str, str] - ] = [] # (symbol, demangled, size, section, component) - for component, symbols in self._component_symbols.items(): - for symbol, demangled, size, section in symbols: - all_symbols.append((symbol, demangled, size, section, component)) + # Collect all symbols from all components: (symbol, demangled, size, section, component) + all_symbols = [ + (symbol, demangled, size, section, component) + for component, symbols in self._component_symbols.items() + for symbol, demangled, size, section in symbols + ] # Get top N symbols by size using heapq for efficiency top_symbols = heapq.nlargest(