mirror of
https://github.com/predis/predis.git
synced 2026-09-16 05:17:02 +00:00
Avoid allocating an iterator to traverse the arguments list of a command.
This commit is contained in:
+2
-1
@@ -424,7 +424,8 @@ abstract class Command implements ICommand {
|
||||
$reqlen = count($arguments) + 1;
|
||||
|
||||
$buffer = "*{$reqlen}{$newline}\${$cmdlen}{$newline}{$command}{$newline}";
|
||||
foreach ($arguments as $argument) {
|
||||
for ($i = 0; $i < $reqlen - 1; $i++) {
|
||||
$argument = $arguments[$i];
|
||||
$arglen = strlen($argument);
|
||||
$buffer .= "\${$arglen}{$newline}{$argument}{$newline}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user