Selaa lähdekoodia

Make the code that process EXEC replies more easy on the eyes.

Daniele Alessandri 13 vuotta sitten
vanhempi
commit
7241fe6419
1 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 5 4
      lib/Predis/Transaction/MultiExecContext.php

+ 5 - 4
lib/Predis/Transaction/MultiExecContext.php

@@ -224,10 +224,11 @@ class MultiExecContext {
             $this->onProtocolError('Unexpected number of responses for a MultiExecContext');
         }
         for ($i = 0; $i < $sizeofReplies; $i++) {
-            $returnValues[] = $commands[$i]->parseResponse($execReply[$i] instanceof \Iterator
-                ? iterator_to_array($execReply[$i])
-                : $execReply[$i]
-            );
+            $commandReply = $execReply[$i];
+            if ($commandReply instanceof \Iterator) {
+                $commandReply = iterator_to_array($commandReply);
+            }
+            $returnValues[$i] = $commands[$i]->parseResponse($commandReply);
             unset($commands[$i]);
         }