[Reformat] Clean all spaces

This commit is contained in:
Quentin Guidée
2020-03-01 00:19:51 +01:00
parent 67a1000ddc
commit 1d048ade53
3 changed files with 1 additions and 28 deletions

View File

@@ -7,8 +7,8 @@
#include <string.h>
#include <new>
#if POINCARE_TREE_LOG
#include <iostream>
#include <ostream>
#include <iostream>
#endif
namespace Poincare {

View File

@@ -256,13 +256,9 @@ public:
Representative::Prefixable::No,
NoPrefix),
},
SolideAngleRepresentatives[] = {
Representative("sr", nullptr, Representative::Prefixable::No, NoPrefix),
},
MassRepresentatives[] = {
Representative("g", nullptr,
Representative::Prefixable::Yes,
@@ -299,15 +295,12 @@ public:
Representative::Prefixable::Yes,
PositiveLongScalePrefixes),
},
LuminousFluxRepresentatives[] = {
Representative("lm", "_cd*_sr", Representative::Prefixable::No, NoPrefix),
},
IlluminanceRepresentatives[] = {
Representative("lx", "_cd*_sr*_m^(-2)", Representative::Prefixable::No, NoPrefix),
},
ForceRepresentatives[] = {
Representative("N", "_kg*_m*_s^-2",
Representative::Prefixable::Yes,

View File

@@ -224,29 +224,14 @@ Unit Unit::Builder(const Dimension * dimension, const Representative * represent
}
Expression Unit::shallowReduce(ExpressionNode::ReductionContext reductionContext) {
if (reductionContext.symbolicComputation() == ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithUndefinedAndDoNotReplaceUnits) {
return *this;
}
UnitNode * unitNode = static_cast<UnitNode *>(node());
const Dimension * dim = unitNode->dimension();
const Representative * rep = unitNode->representative();
const Prefix * pre = unitNode->prefix();
int8_t prefixMultiplier = pre->exponent();
if (rep == dim->stdRepresentative()) {
const Prefix * stdPre = dim->stdRepresentativePrefix();
unitNode->setPrefix(stdPre);
@@ -258,15 +243,10 @@ Expression Unit::shallowReduce(ExpressionNode::ReductionContext reductionContext
} else {
result = Expression::Parse(rep->definition(), nullptr, false).deepReduce(reductionContext);
}
if (prefixMultiplier != 0) {
Expression multiplier = Power::Builder(Rational::Builder(10), Rational::Builder(prefixMultiplier)).shallowReduce(reductionContext);
result = Multiplication::Builder(multiplier, result).shallowReduce(reductionContext);
}
replaceWithInPlace(result);
return result;
}