mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Fixed buggy implementation of CPhysicalQuantity::lessThan.
This bug could cause a variant containing a list containing a null PQ to compare equal to a variant containing a list containing a non-null PQ.
This commit is contained in:
@@ -222,7 +222,10 @@ namespace BlackMisc
|
||||
bool CPhysicalQuantity<MU, PQ>::lessThan(const CPhysicalQuantity<MU, PQ> &other) const
|
||||
{
|
||||
if (*this == other) return false;
|
||||
if (this->isNull() || other.isNull()) return false;
|
||||
|
||||
if (isNull() < other.isNull()) { return true; }
|
||||
if (isNull() > other.isNull()) { return false; }
|
||||
if (isNull() && other.isNull()) { return false; }
|
||||
|
||||
return (m_value < other.value(m_unit));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user