From 9c9657a2e25183ed040d3f307e7930b774860136 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sun, 14 Nov 2010 17:56:00 +0000 Subject: [PATCH] Minor performance tweaks git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@63709 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Calculation.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Classes/PHPExcel/Calculation.php b/Classes/PHPExcel/Calculation.php index 7fd0ade0..f5d547ec 100644 --- a/Classes/PHPExcel/Calculation.php +++ b/Classes/PHPExcel/Calculation.php @@ -2316,10 +2316,12 @@ class PHPExcel_Calculation { if ($resize == 2) { // Given two matrices of (potentially) unequal size, convert the smaller in each dimension to match the larger - self::_resizeMatricesExtend($operand1,$operand2); + self::_resizeMatricesExtend($operand1,$operand2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns); +// self::_resizeMatricesExtend($operand1,$operand2); } elseif ($resize == 1) { // Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller - self::_resizeMatricesShrink($operand1,$operand2); + self::_resizeMatricesShrink($operand1,$operand2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns); +// self::_resizeMatricesShrink($operand1,$operand2); } } // function _checkMatrixOperands() @@ -2353,8 +2355,9 @@ class PHPExcel_Calculation { * @param mixed &$matrix2 Second matrix operand */ private static function _resizeMatricesShrink(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) { - list($matrix1Rows,$matrix1Columns) = self::_getMatrixDimensions($matrix1); - list($matrix2Rows,$matrix2Columns) = self::_getMatrixDimensions($matrix2); +// private static function _resizeMatricesShrink(&$matrix1,&$matrix2) { +// list($matrix1Rows,$matrix1Columns) = self::_getMatrixDimensions($matrix1); +// list($matrix2Rows,$matrix2Columns) = self::_getMatrixDimensions($matrix2); if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) { if ($matrix2Columns < $matrix1Columns) { @@ -2394,9 +2397,10 @@ class PHPExcel_Calculation { * @param mixed &$matrix1 First matrix operand * @param mixed &$matrix2 Second matrix operand */ - private static function _resizeMatricesExtend(&$matrix1,&$matrix2) { - list($matrix1Rows,$matrix1Columns) = self::_getMatrixDimensions($matrix1); - list($matrix2Rows,$matrix2Columns) = self::_getMatrixDimensions($matrix2); + private static function _resizeMatricesExtend(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) { +// private static function _resizeMatricesExtend(&$matrix1,&$matrix2) { +// list($matrix1Rows,$matrix1Columns) = self::_getMatrixDimensions($matrix1); +// list($matrix2Rows,$matrix2Columns) = self::_getMatrixDimensions($matrix2); if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) { if ($matrix2Columns < $matrix1Columns) {