No need to check isset before unset, shortens the code a bit, and added some whitespace
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 20 Sep 2011 13:52:47 +0000 (13:52 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 20 Sep 2011 13:52:47 +0000 (13:52 +0000)
includes/cache/LinkCache.php

index aeb10eb..1deb997 100644 (file)
@@ -114,15 +114,9 @@ class LinkCache {
         */
        public function clearLink( $title ) {
                $dbkey = $title->getPrefixedDbKey();
-               if( isset($this->mBadLinks[$dbkey]) ) {
-                       unset($this->mBadLinks[$dbkey]);
-               }
-               if( isset($this->mGoodLinks[$dbkey]) ) {
-                       unset($this->mGoodLinks[$dbkey]);
-               }
-               if( isset($this->mGoodLinkFields[$dbkey]) ) {
-                       unset($this->mGoodLinkFields[$dbkey]);
-               }
+               unset( $this->mBadLinks[$dbkey] );
+               unset( $this->mGoodLinks[$dbkey] );
+               unset( $this->mGoodLinkFields[$dbkey] );
        }
 
        public function getGoodLinks() { return $this->mGoodLinks; }