mirror of
https://github.com/getgrav/grav.git
synced 2026-09-01 04:58:00 +02:00
calculate only once in loops
This commit is contained in:
@@ -126,7 +126,8 @@ class TwigExtension extends \Twig_Extension
|
||||
$random = array_slice($original, $offset);
|
||||
shuffle($random);
|
||||
|
||||
for ($x=0; $x < sizeof($original); $x++) {
|
||||
$sizeOf = sizeof($original);
|
||||
for ($x=0; $x < $sizeOf; $x++) {
|
||||
if ($x < $offset) {
|
||||
$sorted[] = $original[$x];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user