silverstripe-framework/src
Sam Minnee 6ef5785fc5
FIX: pre-cache loop content within SSViewer.
SSViewer iterates on Iterators that it receives twice: first to get the
total number of items, then to actually render each item.

This necessitates a rewind. In order to make more use of generators,
which are not rewindable, I’d like to remove the need for a rewind.

I’ve done this by caching the content of the iterator as an array
within SSViewer_Scope.

Although this means a bit of memory usage, there are no cases in which
code will get to this point without iterating on all items, which would
use the memory anyway. It would only create onerous impacts in cases
where you are iterating on very long iterators, which would mean you’re
rendering a very large page anyway, and probably have other performance
issues.
2022-09-15 13:29:00 +12:00
..
conf Update deprecation PHPDocs to be PSR-5 compliant 2018-09-28 10:49:14 +02:00
Control ENH Add samesite attribute to cookies. 2022-06-02 12:01:03 +12:00
Core FIX Pass PSR6 caches to ChainAdapter 2022-09-13 16:44:07 +12:00
Dev API Remove support for PDO (#10499) 2022-09-15 13:13:48 +12:00
Forms Revert "Merge pull request #10450 from creative-commoners/pulls/5/rescue-master-generators" (#10483) 2022-09-02 10:58:37 +12:00
i18n API Update translation to use symfony 6 2022-09-08 11:52:34 +12:00
includes ENH Set the default resources dir to "_resources" 2022-08-04 11:36:54 +12:00
Logging ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +12:00
ORM NEW: Make DataList::getIterator a generator 2022-09-15 13:29:00 +12:00
Security Merge branch '4.11' into 4 2022-07-04 13:20:12 +12:00
View FIX: pre-cache loop content within SSViewer. 2022-09-15 13:29:00 +12:00