Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
7742fd5a22
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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;
     }