mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Use set literal instead of function
This commit is contained in:
@@ -307,7 +307,7 @@ class StylesBuilder:
|
|||||||
# If every token in the value is a referenced by the same variable,
|
# If every token in the value is a referenced by the same variable,
|
||||||
# we can display the variable name before the style definition.
|
# we can display the variable name before the style definition.
|
||||||
# TODO: Factor this out to apply it to other properties too.
|
# TODO: Factor this out to apply it to other properties too.
|
||||||
unique_references = set(t.referenced_by for t in tokens if t.referenced_by)
|
unique_references = {t.referenced_by for t in tokens if t.referenced_by}
|
||||||
if tokens and tokens[0].referenced_by and len(unique_references) == 1:
|
if tokens and tokens[0].referenced_by and len(unique_references) == 1:
|
||||||
variable_prefix = f"${tokens[0].referenced_by.name}="
|
variable_prefix = f"${tokens[0].referenced_by.name}="
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user