Pārlūkot izejas kodu

Use a faster method to detect errors when reading a line from the server.

Daniele Alessandri 14 gadi atpakaļ
vecāks
revīzija
2b809325e0
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      lib/Predis.php

+ 1 - 1
lib/Predis.php

@@ -1449,7 +1449,7 @@ class TcpConnection extends Connection implements IConnectionSingle {
         $value  = '';
         do {
             $chunk = fgets($socket);
-            if ($chunk === false || strlen($chunk) == 0) {
+            if ($chunk === false || $chunk === '') {
                 $this->onCommunicationException('Error while reading line from the server');
             }
             $value .= $chunk;