From 2f708cc36cbf5dc1f03c9e602d014a6753773cee Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Mon, 24 Feb 2020 16:51:57 +0100 Subject: [PATCH] [poincare/unit] Dimension::Vector::FromBaseUnits accepts only products of powers of base units and no other factor at all --- poincare/src/unit.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/poincare/src/unit.cpp b/poincare/src/unit.cpp index 9011a8224..2fa6ca495 100644 --- a/poincare/src/unit.cpp +++ b/poincare/src/unit.cpp @@ -127,13 +127,8 @@ Unit::Dimension::Vector UnitNode::Dimension::Vector::FromBaseU factor = factor.childAtIndex(0); } - // FIXME Remove this once this case may not occur anymore - // The leading factors may not be of Unit type - if (factor.type() != ExpressionNode::Type::Unit) { - continue; - } - // Fill the vector with the unit's exponent + assert(factor.type() == ExpressionNode::Type::Unit); const ptrdiff_t indexInTable = static_cast(factor.node())->dimension() - Unit::DimensionTable; assert(0 <= indexInTable && indexInTable < NumberOfBaseUnits); vector.setCoefficientAtIndex(indexInTable, exponent);