Forráskód Böngészése

Apply minor change in command serialization.

Daniele Alessandri 11 éve
szülő
commit
1125dc1bdd

+ 1 - 1
lib/Predis/Connection/StreamConnection.php

@@ -255,7 +255,7 @@ class StreamConnection extends AbstractConnection
 
         $buffer = "*{$reqlen}\r\n\${$cmdlen}\r\n{$commandID}\r\n";
 
-        for ($i = 0; $i < $reqlen - 1; $i++) {
+        for ($i = 0, $reqlen--; $i < $reqlen; $i++) {
             $argument = $arguments[$i];
             $arglen = strlen($argument);
             $buffer .= "\${$arglen}\r\n{$argument}\r\n";

+ 1 - 1
lib/Predis/Protocol/Text/RequestSerializer.php

@@ -35,7 +35,7 @@ class RequestSerializer implements RequestSerializerInterface
 
         $buffer = "*{$reqlen}\r\n\${$cmdlen}\r\n{$commandID}\r\n";
 
-        for ($i = 0; $i < $reqlen - 1; $i++) {
+        for ($i = 0, $reqlen--; $i < $reqlen; $i++) {
             $argument = $arguments[$i];
             $arglen = strlen($argument);
             $buffer .= "\${$arglen}\r\n{$argument}\r\n";