mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
refactor: use is_zero() instead of comparing with Au::Zero() (#36347)
Use `is_zero()` instead of comparing with `Au::Zero()` for zero checks. Testing: This change does not cause behaviour change, a test is not necessary. Fixes: #36300 --------- Signed-off-by: Barigbue <barigbuenbira@gmail.com>
This commit is contained in:
parent
2fe57cc2a2
commit
a0730d7154
7 changed files with 16 additions and 14 deletions
|
@ -1071,7 +1071,7 @@ fn allocate_free_cross_space_for_flex_line(
|
|||
remaining_free_cross_space: Au,
|
||||
remaining_line_count: i32,
|
||||
) -> (Au, Au) {
|
||||
if remaining_free_cross_space == Au::zero() {
|
||||
if remaining_free_cross_space.is_zero() {
|
||||
return (Au::zero(), Au::zero());
|
||||
}
|
||||
|
||||
|
@ -1394,7 +1394,7 @@ impl InitialFlexLineLayout<'_> {
|
|||
//
|
||||
// FIXME: is it a problem if floating point precision errors accumulate
|
||||
// and we get not-quite-zero remaining free space when we should get zero here?
|
||||
if remaining_free_space != Au::zero() {
|
||||
if !remaining_free_space.is_zero() {
|
||||
// > If using the flex grow factor:
|
||||
// > For every unfrozen item on the line, find the ratio of the item’s flex grow factor to
|
||||
// > the sum of the flex grow factors of all unfrozen items on the line. Set the item’s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue