WatchedItemStore::countVisitingWatchersMultiple() shouldn't query all titles when...
[lhc/web/wiklou.git] / includes / watcheditem / WatchedItemStore.php
index 6e907de..6b0c2aa 100644 (file)
@@ -407,6 +407,11 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                array $targetsWithVisitThresholds,
                $minimumWatchers = null
        ) {
+               if ( $targetsWithVisitThresholds === [] ) {
+                       // No titles requested => no results returned
+                       return [];
+               }
+
                $dbr = $this->getConnectionRef( DB_REPLICA );
 
                $conds = $this->getVisitingWatchersCondition( $dbr, $targetsWithVisitThresholds );