mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-03 05:57:46 +00:00
Merge pull request #2915 from PHPOffice/Performance-Refresh-Row/Column-Dimensions
Minor memory improvement
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user