소스 검색

Fix the bitmask used to check the state of subscriptions in a PubSub context.

The old code was not really broken, but this one is more appropriate.
Daniele Alessandri 14 년 전
부모
커밋
7742fd5a22
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/Predis/PubSubContext.php

+ 1 - 1
lib/Predis/PubSubContext.php

@@ -112,7 +112,7 @@ class PubSubContext implements \Iterator {
 
     public function valid() {
         $isValid = $this->isFlagSet(self::STATUS_VALID);
-        $subscriptionFlags = self::STATUS_SUBSCRIBED + self::STATUS_PSUBSCRIBED;
+        $subscriptionFlags = self::STATUS_SUBSCRIBED | self::STATUS_PSUBSCRIBED;
         $hasSubscriptions = ($this->_statusFlags & $subscriptionFlags) > 0;
         return $isValid && $hasSubscriptions;
     }