aboutsummaryrefslogtreecommitdiff
path: root/p/api
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2024-12-07 12:09:29 +0100
committerGravatar GitHub <noreply@github.com> 2024-12-07 12:09:29 +0100
commit6302404ead0b69db23c1fcb63e4c39b169f8c799 (patch)
tree9dc6a936c36ea6ee57faaca10e9b405427162e94 /p/api
parent93578e1bc86b83c4e6d0ac9b4bdc54bdc62c3f27 (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')
-rw-r--r--p/api/fever.php4
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, ',');
}