Minor performance tweak

This commit is contained in:
Mark Baker 2013-04-29 00:06:06 +01:00
parent cbe9e35e6f
commit 9ecce7f009
1 changed files with 10 additions and 10 deletions

View File

@ -2436,6 +2436,11 @@ class PHPExcel_Calculation {
*/ */
private static function _resizeMatricesShrink(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) { private static function _resizeMatricesShrink(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) {
if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) { if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
if ($matrix2Rows < $matrix1Rows) {
for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
unset($matrix1[$i]);
}
}
if ($matrix2Columns < $matrix1Columns) { if ($matrix2Columns < $matrix1Columns) {
for ($i = 0; $i < $matrix1Rows; ++$i) { for ($i = 0; $i < $matrix1Rows; ++$i) {
for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) { for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
@ -2443,14 +2448,14 @@ class PHPExcel_Calculation {
} }
} }
} }
if ($matrix2Rows < $matrix1Rows) {
for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
unset($matrix1[$i]);
}
}
} }
if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) { if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
if ($matrix1Rows < $matrix2Rows) {
for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
unset($matrix2[$i]);
}
}
if ($matrix1Columns < $matrix2Columns) { if ($matrix1Columns < $matrix2Columns) {
for ($i = 0; $i < $matrix2Rows; ++$i) { for ($i = 0; $i < $matrix2Rows; ++$i) {
for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) { for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
@ -2458,11 +2463,6 @@ class PHPExcel_Calculation {
} }
} }
} }
if ($matrix1Rows < $matrix2Rows) {
for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
unset($matrix2[$i]);
}
}
} }
} // function _resizeMatricesShrink() } // function _resizeMatricesShrink()