From 710d5259fe36d2a013a38b059993b81c5333909a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 5 Nov 2019 09:41:26 +0100 Subject: [PATCH] [poincare] NAryExpressionNode: clean sortChildrenInPlace (the loop was in descending order without any explanation) --- poincare/src/n_ary_expression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poincare/src/n_ary_expression.cpp b/poincare/src/n_ary_expression.cpp index bc6719375..538c1f21b 100644 --- a/poincare/src/n_ary_expression.cpp +++ b/poincare/src/n_ary_expression.cpp @@ -25,7 +25,7 @@ bool NAryExpressionNode::childAtIndexNeedsUserParentheses(const Expression & chi void NAryExpressionNode::sortChildrenInPlace(ExpressionOrder order, Context * context, bool canSwapMatrices, bool canBeInterrupted) { Expression reference(this); - for (int i = reference.numberOfChildren()-1; i > 0; i--) { + for (int i = 1; i < reference.numberOfChildren(); i++) { bool isSorted = true; for (int j = 0; j < reference.numberOfChildren()-1; j++) { /* Warning: Matrix operations are not always commutative (ie,