Skip to content

Commit

Permalink
optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Dec 14, 2021
1 parent a1dd339 commit c2c506f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rich/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ def divide(self, offsets: Iterable[int]) -> Lines:
if not self._spans:
return new_lines

_lines = new_lines._lines
_lines = [line._spans.append for line in new_lines._lines]
line_count = len(line_ranges)
_Span = Span

Expand Down Expand Up @@ -1098,7 +1098,7 @@ def divide(self, offsets: Iterable[int]) -> Lines:
new_start = max(0, span_start - line_start)
new_end = min(span_end - line_start, line_end - line_start)
if new_end > new_start:
line._spans.append(_Span(new_start, new_end, style))
line(_Span(new_start, new_end, style))

return new_lines

Expand Down

0 comments on commit c2c506f

Please sign in to comment.