Minor memory improvement

This commit is contained in:
MarkBaker 2022-06-29 22:09:16 +02:00
parent 177a362f38
commit 715b50a77c
2 changed files with 4 additions and 6 deletions

View File

@ -316,6 +316,7 @@ class ReferenceHelper
$objColumnDimension->setColumnIndex($newReference);
}
}
$worksheet->refreshColumnDimensions();
}
}
@ -339,6 +340,7 @@ class ReferenceHelper
$objRowDimension->setRowIndex($newRoweference);
}
}
$worksheet->refreshRowDimensions();
$copyDimension = $worksheet->getRowDimension($beforeRow - 1);

View File

@ -658,10 +658,8 @@ class Worksheet implements IComparable
*/
public function refreshColumnDimensions()
{
$currentColumnDimensions = $this->getColumnDimensions();
$newColumnDimensions = [];
foreach ($currentColumnDimensions as $objColumnDimension) {
foreach ($this->getColumnDimensions() as $objColumnDimension) {
$newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension;
}
@ -677,10 +675,8 @@ class Worksheet implements IComparable
*/
public function refreshRowDimensions()
{
$currentRowDimensions = $this->getRowDimensions();
$newRowDimensions = [];
foreach ($currentRowDimensions as $objRowDimension) {
foreach ($this->getRowDimensions() as $objRowDimension) {
$newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
}