Skip to content

Commit 2fda4f0

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: inline visible alias in _LivePanelBase._build_body
The `visible = self._scroll_lines[-_MAX_VISIBLE_SCROLL:]` local was read exactly once as the iterable of the very next `for line in ...` loop. Collapsing to `for line in self._scroll_lines[-_MAX_VISIBLE_SCROLL:]:` matches the inline-alias pattern from 497c028 / fc5e1cb / 52e0272 / ce487d3 / e1ad87a — the slice already documents "the last N scroll lines" without needing a named intermediate. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 1ffe9c2 commit 2fda4f0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ralphify/_console_emitter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,7 @@ def _build_body(self) -> Group:
412412
"""Body group: scroll lines (or peek message) + spacer + footer."""
413413
rows: list[Any] = []
414414
if self._peek_visible:
415-
visible = self._scroll_lines[-_MAX_VISIBLE_SCROLL:]
416-
for line in visible:
415+
for line in self._scroll_lines[-_MAX_VISIBLE_SCROLL:]:
417416
line.no_wrap = True
418417
line.overflow = "ellipsis"
419418
rows.append(line)

0 commit comments

Comments
 (0)