Avoid allocating an iterator to traverse the arguments list of a command.

This commit is contained in:
Daniele Alessandri
2011-01-02 21:42:54 +01:00
parent e645ed7d3f
commit a1db042d17
+2 -1
View File
@@ -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}";
}