Skip to content

Commit 6d483fb

Browse files
committed
micro optimization
1 parent 9986e51 commit 6d483fb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/textual/css/styles.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,16 @@ def is_relative_height(self, _relative_units={Unit.FRACTION, Unit.PERCENT}) -> b
555555
return height is not None and height.unit in _relative_units
556556

557557
@property
558-
def is_auto_width(self) -> bool:
558+
def is_auto_width(self, _auto=Unit.AUTO) -> bool:
559559
"""Does the node have automatic width?"""
560560
width = self.width
561-
return width is not None and width.unit == Unit.AUTO
561+
return width is not None and width.unit == _auto
562562

563563
@property
564-
def is_auto_height(self) -> bool:
564+
def is_auto_height(self, _auto=Unit.AUTO) -> bool:
565565
"""Does the node have automatic height?"""
566566
height = self.height
567-
return height is not None and height.unit == Unit.AUTO
567+
return height is not None and height.unit == _auto
568568

569569
@property
570570
def is_dynamic_height(
@@ -577,14 +577,12 @@ def is_dynamic_height(
577577
@property
578578
def is_docked(self) -> bool:
579579
"""Is the node docked?"""
580-
dock = self.dock
581-
return dock != "none"
580+
return self.dock != "none"
582581

583582
@property
584583
def is_split(self) -> bool:
585584
"""Is the node split?"""
586-
split = self.split
587-
return split != "none"
585+
return self.split != "none"
588586

589587
def has_rule(self, rule_name: str) -> bool:
590588
"""Check if a rule is set on this Styles object.

0 commit comments

Comments
 (0)