Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / includes / specials / SpecialUnwatchedpages.php
index a4e96ae..ae375b2 100644 (file)
@@ -43,6 +43,26 @@ class UnwatchedpagesPage extends QueryPage {
                return false;
        }
 
+       /**
+        * Pre-cache page existence to speed up link generation
+        *
+        * @param IDatabase $db
+        * @param ResultWrapper $res
+        */
+       public function preprocessResults( $db, $res ) {
+               if ( !$res->numRows() ) {
+                       return;
+               }
+
+               $batch = new LinkBatch();
+               foreach ( $res as $row ) {
+                       $batch->add( $row->namespace, $row->title );
+               }
+               $batch->execute();
+
+               $res->seek( 0 );
+       }
+
        public function getQueryInfo() {
                $dbr = wfGetDB( DB_REPLICA );
                return [