General: (cdhutch) Work item 20055 - remove array_shift in ReferenceHelper::insertNewBefore improves column or row delete speed

This commit is contained in:
Mark Baker
2013-08-18 12:32:40 +01:00
parent 44f953b69d
commit 29746bb995
2 changed files with 9 additions and 2 deletions
+5 -1
View File
@@ -424,7 +424,11 @@ class PHPExcel_ReferenceHelper
}
// Loop through cells, bottom-up, and change cell coordinates
while (($cellID = $remove ? array_shift($aCellCollection) : array_pop($aCellCollection))) {
if($remove) {
// It's faster to reverse and pop than to use unshift, especially with large cell collections
$aCellCollection = array_reverse($aCellCollection);
}
while ($cellID = array_pop($aCellCollection)) {
$cell = $pSheet->getCell($cellID);
$cellIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn());
if ($cellIndex-1 + $pNumCols < 0) {