Skip to content

Commit e89df6e

Browse files
pcfistxperiandri
andcommitted
Use Max() instead of conditional statement
Suggested in code review, see !599 Co-authored-by: Andrii Chebukin <[email protected]>
1 parent 39d496d commit e89df6e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

components/DataTable/src/DataTable/DataTable.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ protected override Size MeasureOverride(Size availableSize)
9696

9797
// Avoid negative values when columns don't fit `availableSize`. Otherwise the `Size` constructor will throw.
9898
double width = availableSize.Width - fixedWidth - autoSized;
99-
if (width < 0)
100-
width = 0;
99+
width = Math.Max(width, 0);
101100
column.Measure(new Size(width, availableSize.Height));
102101

103102
// Keep track of already 'allotted' space, use either the maximum child size (if we know it) or the header content

0 commit comments

Comments
 (0)