[poincare/matrix_identity] Do not create matrix for dim > 15

We know this would fill up the pool
This commit is contained in:
Léa Saviot
2019-08-22 10:33:50 +02:00
parent c980f8bf7c
commit 2ddeaf5074

View File

@@ -58,7 +58,7 @@ Expression MatrixIdentity::shallowReduce(ExpressionNode::ReductionContext reduct
if (dimension.isNegative() || dimension.isZero()) {
return replaceWithUndefinedInPlace();
}
if (Integer::NaturalOrder(dimension, Integer(Integer::k_maxExtractableInteger)) > 0) {
if (Integer::NaturalOrder(dimension, Integer(15)) > 0) { // For now, after 15 it would fill the pool
return *this;
}
int dim = dimension.extractedInt();