mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare/n_ary_expression] Do not compute numberOfChildren repeatedly
This commit is contained in:
committed by
Léa Saviot
parent
466f588a99
commit
13391d486e
@@ -25,9 +25,10 @@ bool NAryExpressionNode::childAtIndexNeedsUserParentheses(const Expression & chi
|
||||
|
||||
void NAryExpressionNode::sortChildrenInPlace(ExpressionOrder order, Context * context, bool canSwapMatrices, bool canBeInterrupted) {
|
||||
Expression reference(this);
|
||||
for (int i = 1; i < reference.numberOfChildren(); i++) {
|
||||
const int childrenCount = reference.numberOfChildren();
|
||||
for (int i = 1; i < childrenCount; i++) {
|
||||
bool isSorted = true;
|
||||
for (int j = 0; j < reference.numberOfChildren()-1; j++) {
|
||||
for (int j = 0; j < childrenCount-1; j++) {
|
||||
/* Warning: Matrix operations are not always commutative (ie,
|
||||
* multiplication) so we never swap 2 matrices. */
|
||||
ExpressionNode * cj = childAtIndex(j);
|
||||
|
||||
Reference in New Issue
Block a user