From 6302404ead0b69db23c1fcb63e4c39b169f8c799 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:09:29 +0100 Subject: Optimize code: (#6983) before count(...)' is used in a loop and is a low performing construction. after Foreach instead (easier to read and support) Co-authored-by: LucS --- p/api/fever.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'p/api/fever.php') diff --git a/p/api/fever.php b/p/api/fever.php index 8748882e5..7bab2ce5d 100644 --- a/p/api/fever.php +++ b/p/api/fever.php @@ -69,9 +69,9 @@ final class FeverDAO extends Minz_ModelPdo */ private function bindParamArray(string $prefix, array $values, array &$bindArray): string { $str = ''; - for ($i = 0; $i < count($values); $i++) { + foreach ($values as $i => $iValue) { $str .= ':' . $prefix . $i . ','; - $bindArray[$prefix . $i] = $values[$i]; + $bindArray[$prefix . $i] = $iValue; } return rtrim($str, ','); } -- cgit v1.2.3