From 4b955eeb63e4161763b1a646816587e4184e2b46 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 10 Dec 2018 18:20:39 +0100 Subject: [PATCH] Fix decrement order --- Math/Geometry/ConvexHull/MonotoneChain.php | 2 +- Math/Matrix/CholeskyDecomposition.php | 2 +- Utils/RnG/ArrayRandomize.php | 2 +- Validation/Finance/CreditCard.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Math/Geometry/ConvexHull/MonotoneChain.php b/Math/Geometry/ConvexHull/MonotoneChain.php index 889edbf45..0874cd115 100644 --- a/Math/Geometry/ConvexHull/MonotoneChain.php +++ b/Math/Geometry/ConvexHull/MonotoneChain.php @@ -62,7 +62,7 @@ final class MonotoneChain } // Upper hull - for ($i = $n - 2, $t = $k + 1; $i >= 0; $i--) { + for ($i = $n - 2, $t = $k + 1; $i >= 0; --$i) { while ($k >= $t && self::cross($result[$k - 2], $result[$k - 1], $points[$i]) <= 0) { $k--; } diff --git a/Math/Matrix/CholeskyDecomposition.php b/Math/Matrix/CholeskyDecomposition.php index 49b3be002..f43e1ef9d 100644 --- a/Math/Matrix/CholeskyDecomposition.php +++ b/Math/Matrix/CholeskyDecomposition.php @@ -150,7 +150,7 @@ final class CholeskyDecomposition } // Solve L'*X = Y; - for ($k = $this->m - 1; $k >= 0; $k--) { + for ($k = $this->m - 1; $k >= 0; --$k) { for ($j = 0; $j < $n; ++$j) { for ($i = $k + 1; $i < $this->m; ++$i) { $X[$k][$j] -= $X[$i][$j] * $this->L[$i][$k]; diff --git a/Utils/RnG/ArrayRandomize.php b/Utils/RnG/ArrayRandomize.php index c866000e1..b62ae7d36 100644 --- a/Utils/RnG/ArrayRandomize.php +++ b/Utils/RnG/ArrayRandomize.php @@ -59,7 +59,7 @@ class ArrayRandomize { $shuffled = []; - for ($i = \count($arr) - 1; $i > 0; $i--) { + for ($i = \count($arr) - 1; $i > 0; --$i) { $rnd = \mt_rand(0, $i); $shuffled[$i] = $arr[$rnd]; $shuffled[$rnd] = $arr[$i]; diff --git a/Validation/Finance/CreditCard.php b/Validation/Finance/CreditCard.php index 880cd3f99..152bf943c 100644 --- a/Validation/Finance/CreditCard.php +++ b/Validation/Finance/CreditCard.php @@ -72,7 +72,7 @@ final class CreditCard extends ValidatorAbstract $len = \strlen($num); $sum = 0; - for ($i = $len - 1; $i >= 0; $i--) { + for ($i = $len - 1; $i >= 0; --$i) { $ord = \ord($num[$i]); if (($len - 1) & $i) {