Use gt operator instead of max for highest row
Using an operator is significantly faster than calling the max function. As this method is called more than once per cell the difference adds up. Closes #824
This commit is contained in:
parent
ff6f4f4ec0
commit
0f8292fc0b
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue