summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorWander Lairson Costa <wander@redhat.com>2026-02-23 13:18:01 -0300
committerGabriele Monaco <gmonaco@redhat.com>2026-04-01 10:16:20 +0200
commit5d98f7f5b96c4abc9325c0d851b7d287d24aee93 (patch)
treea6009215f0240aec13eb3fc8d4deffc197b33921 /tools/perf/scripts/python/stackcollapse.py
parent957dcbf0b663385dddb3eaa5cf5de5109255696f (diff)
rv/rvgen: fix unbound loop variable warning
Pyright static analysis reports a "possibly unbound variable" warning for the loop variable `i` in the `abbreviate_atoms` function. The variable is accessed after the inner loop terminates to slice the atom string. While the loop logic currently ensures execution, the analyzer flags the reliance on the loop variable persisting outside its scope. Refactor the prefix length calculation into a nested `find_share_length` helper function. This encapsulates the search logic and uses explicit return statements, ensuring the length value is strictly defined. This satisfies the type checker and improves code readability without altering the runtime behavior. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Reviewed-by: Gabriele Monaco <gmonaco@redhat.com> Link: https://lore.kernel.org/r/20260223162407.147003-19-wander@redhat.com Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions