From a811f598beb19929d15cba3c8ba5cc4bad87e575 Mon Sep 17 00:00:00 2001 From: Maayan Matsliah Date: Mon, 4 May 2026 14:51:26 -0400 Subject: [PATCH] refactor: use += for period, samples, and count accumulation --- src/mx/_impl/mx_proftool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mx/_impl/mx_proftool.py b/src/mx/_impl/mx_proftool.py index 26bb2c3cf..2fc916222 100644 --- a/src/mx/_impl/mx_proftool.py +++ b/src/mx/_impl/mx_proftool.py @@ -1185,8 +1185,8 @@ def merge_perf_events(self): for event in self.events: e = events_by_address.get(event.pc) if e: - e.period = e.period + event.period - e.samples = e.samples + event.samples + e.period += event.period + e.samples += event.samples else: # avoid mutating the underlying raw event events_by_address[event.pc] = copy.copy(event) @@ -1201,7 +1201,7 @@ def get_top_methods(self): count = hot_symbols.get(key) if count is None: count = 0 - count = count + event.period + count += event.period hot_symbols[key] = count entries = [(s, d, c) for (s, d), c in hot_symbols.items()]