From a62353dd6911aade1428517d4233e4f5ed36a273 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Fri, 31 Jul 2015 09:45:57 +0200 Subject: [PATCH] Use a variable holding a value instead of calling count() inside a loop on every iteration. --- modules/statistics/lib/StatDataset.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/statistics/lib/StatDataset.php b/modules/statistics/lib/StatDataset.php index fab589d87..b8c333f65 100644 --- a/modules/statistics/lib/StatDataset.php +++ b/modules/statistics/lib/StatDataset.php @@ -298,8 +298,9 @@ class sspmod_statistics_StatDataset { } $combined = $resarray[0]; - if(count($resarray) > 1) { - for($i = 1; $i < count($resarray); $i++) { + $count = count($resarray); + if($count > 1) { + for($i = 1; $i < $count; $i++) { $combined = $this->combine($combined, $resarray[$i]); } } -- GitLab