Skip to content

Commit 2e46624

Browse files
committed
possible optimization
1 parent ec32597 commit 2e46624

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/textual/markup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from __future__ import annotations
77

8-
from operator import attrgetter
8+
from operator import itemgetter
99

1010
from textual.css.parse import substitute_references
1111
from textual.css.tokenizer import UnexpectedEnd
@@ -420,7 +420,7 @@ def process_text(template_text: str, /) -> str:
420420
]
421421
)
422422
spans.reverse()
423-
spans.sort(key=attrgetter("start"))
423+
spans.sort(key=itemgetter(0)) # Zeroth item of Span is 'start' attribute
424424

425425
content = Content(
426426
content_text,

0 commit comments

Comments
 (0)