From c6b095b626a44f6da2133cafea094a19a6cdabf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rodr=C3=ADguez?= Date: Sat, 1 Oct 2022 21:12:21 +0200 Subject: [PATCH] Reduces extra memory usage on `__destruct()` calls (#3094) * fix: Reduces memory usage on __destruct() call * docs: CHANGELOG.md Co-authored-by: Jose Rodriguez --- CHANGELOG.md | 2 +- src/PhpSpreadsheet/Collection/Cells.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bf3d568..76832f6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Fixed -- Nothing +- Reduces extra memory usage on `__destruct()` calls ## 1.25.2 - 2022-09-25 diff --git a/src/PhpSpreadsheet/Collection/Cells.php b/src/PhpSpreadsheet/Collection/Cells.php index 82c9ae1a..6183e733 100644 --- a/src/PhpSpreadsheet/Collection/Cells.php +++ b/src/PhpSpreadsheet/Collection/Cells.php @@ -465,7 +465,7 @@ class Cells */ private function getAllCacheKeys() { - foreach ($this->getCoordinates() as $coordinate) { + foreach ($this->index as $coordinate => $value) { yield $this->cachePrefix . $coordinate; } }