From 49c75296cf1d9ce88898188a1a0365fc8bacaa3e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 1 Feb 2026 21:51:54 +0100 Subject: [PATCH] perform tweak --- esphome/analyze_memory/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/analyze_memory/cli.py b/esphome/analyze_memory/cli.py index 15c3a64f97..72a73dbdd4 100644 --- a/esphome/analyze_memory/cli.py +++ b/esphome/analyze_memory/cli.py @@ -5,6 +5,7 @@ from __future__ import annotations from collections import defaultdict from collections.abc import Callable import heapq +from operator import itemgetter import sys from typing import TYPE_CHECKING @@ -163,7 +164,7 @@ class MemoryAnalyzerCLI(MemoryAnalyzer): # Get top N symbols by size using heapq for efficiency top_symbols = heapq.nlargest( - self.TOP_SYMBOLS_LIMIT, all_symbols, key=lambda x: x[2] + self.TOP_SYMBOLS_LIMIT, all_symbols, key=itemgetter(2) ) lines.append("")