Skip to content

Commit a1c2532

Browse files
committed
refactor: Simplify LinksLineBlock implementation for better readability
1 parent e29cc97 commit a1c2532

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

elementary/messages/block_builders.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,11 @@ def LinkLineBlock(*, text: str, url: str) -> LineBlock:
9898

9999
def LinksLineBlock(*, links: list[tuple[str, str, Optional[Icon]]]) -> LineBlock:
100100
return LineBlock(
101-
inlines=sum(
102-
[
103-
LinkInlineBlocks(text=text, url=url, icon=icon)
104-
for text, url, icon in links
105-
],
106-
[],
107-
)
101+
inlines=[
102+
inline
103+
for text, url, icon in links
104+
for inline in LinkInlineBlocks(text=text, url=url, icon=icon)
105+
]
108106
)
109107

110108

0 commit comments

Comments
 (0)