[libcalamares] Handle all SizeUnit cases inside switch
- Although None will be filtered out already by unitsComparable(), include it in the switch to avoid a warning .. then we can drop the post-switch return since the switch covers all possible values of the enum.
This commit is contained in:
parent
90975b62bf
commit
6db09f0679
@ -176,6 +176,8 @@ PartitionSize::operator< ( const PartitionSize& other ) const
|
||||
|
||||
switch ( m_unit )
|
||||
{
|
||||
case SizeUnit::None:
|
||||
return false;
|
||||
case SizeUnit::Percent:
|
||||
return ( m_value < other.m_value );
|
||||
case SizeUnit::Byte:
|
||||
@ -184,8 +186,6 @@ PartitionSize::operator< ( const PartitionSize& other ) const
|
||||
case SizeUnit::GiB:
|
||||
return ( toBytes() < other.toBytes () );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -196,6 +196,8 @@ PartitionSize::operator> ( const PartitionSize& other ) const
|
||||
|
||||
switch ( m_unit )
|
||||
{
|
||||
case SizeUnit::None:
|
||||
return false;
|
||||
case SizeUnit::Percent:
|
||||
return ( m_value > other.m_value );
|
||||
case SizeUnit::Byte:
|
||||
@ -204,8 +206,6 @@ PartitionSize::operator> ( const PartitionSize& other ) const
|
||||
case SizeUnit::GiB:
|
||||
return ( toBytes() > other.toBytes () );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -216,6 +216,8 @@ PartitionSize::operator== ( const PartitionSize& other ) const
|
||||
|
||||
switch ( m_unit )
|
||||
{
|
||||
case SizeUnit::None:
|
||||
return false;
|
||||
case SizeUnit::Percent:
|
||||
return ( m_value == other.m_value );
|
||||
case SizeUnit::Byte:
|
||||
@ -224,8 +226,6 @@ PartitionSize::operator== ( const PartitionSize& other ) const
|
||||
case SizeUnit::GiB:
|
||||
return ( toBytes() == other.toBytes () );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace Calamares
|
||||
|
Loading…
Reference in New Issue
Block a user