diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d1553d0..7483ac3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Change `libxml_disable_entity_loader()` as shortly as possible - [#819](https://github.com/PHPOffice/PhpSpreadsheet/pull/819) - Improved memory usage and performance when loading large spreadsheets - [#822](https://github.com/PHPOffice/PhpSpreadsheet/pull/822) - Improved performance when loading large spreadsheets - [#825](https://github.com/PHPOffice/PhpSpreadsheet/pull/825) +- Improved performance when loading large spreadsheets - [#824](https://github.com/PHPOffice/PhpSpreadsheet/pull/824) ## [1.5.2] - 2018-11-25 diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index dd233901..d0224037 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -1268,7 +1268,9 @@ class Worksheet implements IComparable if (Coordinate::columnIndexFromString($this->cachedHighestColumn) < Coordinate::columnIndexFromString($aCoordinates[0])) { $this->cachedHighestColumn = $aCoordinates[0]; } - $this->cachedHighestRow = max($this->cachedHighestRow, $aCoordinates[1]); + if ($aCoordinates[1] > $this->cachedHighestRow) { + $this->cachedHighestRow = $aCoordinates[1]; + } // Cell needs appropriate xfIndex from dimensions records // but don't create dimension records if they don't already exist