Simplify switch in BacklinkCache::getConditions
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 1 Dec 2013 10:55:44 +0000 (11:55 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 1 Dec 2013 10:55:44 +0000 (11:55 +0100)
Change-Id: I9f1ddad705d1697dd81f74eb735dc386bab9d200

includes/cache/BacklinkCache.php

index 8eed1a5..686361b 100644 (file)
@@ -274,8 +274,6 @@ class BacklinkCache {
        protected function getConditions( $table ) {
                $prefix = $this->getPrefix( $table );
 
-               // @todo FIXME: imagelinks and categorylinks do not rely on getNamespace,
-               // they could be moved up for nicer case statements
                switch ( $table ) {
                        case 'pagelinks':
                        case 'templatelinks':
@@ -297,14 +295,9 @@ class BacklinkCache {
                                );
                                break;
                        case 'imagelinks':
-                               $conds = array(
-                                       'il_to' => $this->title->getDBkey(),
-                                       "page_id={$prefix}_from"
-                               );
-                               break;
                        case 'categorylinks':
                                $conds = array(
-                                       'cl_to' => $this->title->getDBkey(),
+                                       "{$prefix}_to" => $this->title->getDBkey(),
                                        "page_id={$prefix}_from"
                                );
                                break;