Minor performance tweaks

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@63709 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2010-11-14 17:56:00 +00:00
parent 270ea1df05
commit 9c9657a2e2
1 changed files with 11 additions and 7 deletions

View File

@ -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) {