diff options
| author | 2024-12-07 12:09:29 +0100 | |
|---|---|---|
| committer | 2024-12-07 12:09:29 +0100 | |
| commit | 6302404ead0b69db23c1fcb63e4c39b169f8c799 (patch) | |
| tree | 9dc6a936c36ea6ee57faaca10e9b405427162e94 /p/api/fever.php | |
| parent | 93578e1bc86b83c4e6d0ac9b4bdc54bdc62c3f27 (diff) | |
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 <l.sanchez-prestataire@alptis.fr>
Diffstat (limited to 'p/api/fever.php')
| -rw-r--r-- | p/api/fever.php | 4 |
1 files changed, 2 insertions, 2 deletions
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, ','); } |
