Use more efficient bool to int conversion

This commit is contained in:
Darren Burns
2022-06-28 18:52:47 +01:00
parent 8617cbdc70
commit c00de10262
2 changed files with 6 additions and 2 deletions

View File

@@ -2,5 +2,5 @@
height: 50%;
width: 50%;
align: center middle;
background: blue;
background: green;
}

View File

@@ -530,7 +530,11 @@ class Styles(StylesBase):
rules = [
(
rule_name,
(int(not is_widget_rule), int(is_important(rule_name)), *specificity),
(
0 if is_widget_rule else 1,
1 if is_important(rule_name) else 0,
*specificity,
),
rule_value,
)
for rule_name, rule_value in self._rules.items()