diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e82dce4..43aab409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix VLOOKUP with exact matches - [#809](https://github.com/PHPOffice/PhpSpreadsheet/pull/809) - Support COUNTIFS multiple arguments - [#830](https://github.com/PHPOffice/PhpSpreadsheet/pull/830) - 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) ## [1.5.2] - 2018-11-25 diff --git a/src/PhpSpreadsheet/Collection/Cells.php b/src/PhpSpreadsheet/Collection/Cells.php index b87b805e..80a43220 100644 --- a/src/PhpSpreadsheet/Collection/Cells.php +++ b/src/PhpSpreadsheet/Collection/Cells.php @@ -495,15 +495,12 @@ class Cells /** * Returns all known cache keys. * - * @return string[] + * @return \Generator|string[] */ private function getAllCacheKeys() { - $keys = []; foreach ($this->getCoordinates() as $coordinate) { - $keys[] = $this->cachePrefix . $coordinate; + yield $this->cachePrefix . $coordinate; } - - return $keys; } }