r97626 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97625‎ | r97626 | r97627 >
Date:13:52, 20 September 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
No need to check isset before unset, shortens the code a bit, and added some whitespace
Modified paths:
  • /trunk/phase3/includes/cache/LinkCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/cache/LinkCache.php
@@ -114,15 +114,9 @@
115115 */
116116 public function clearLink( $title ) {
117117 $dbkey = $title->getPrefixedDbKey();
118 - if( isset($this->mBadLinks[$dbkey]) ) {
119 - unset($this->mBadLinks[$dbkey]);
120 - }
121 - if( isset($this->mGoodLinks[$dbkey]) ) {
122 - unset($this->mGoodLinks[$dbkey]);
123 - }
124 - if( isset($this->mGoodLinkFields[$dbkey]) ) {
125 - unset($this->mGoodLinkFields[$dbkey]);
126 - }
 118+ unset( $this->mBadLinks[$dbkey] );
 119+ unset( $this->mGoodLinks[$dbkey] );
 120+ unset( $this->mGoodLinkFields[$dbkey] );
127121 }
128122
129123 public function getGoodLinks() { return $this->mGoodLinks; }

Sign-offs

UserFlagDate
Hasharinspected16:44, 17 October 2011
Hashartested16:44, 17 October 2011

Comments

#Comment by Hashar (talk | contribs)   16:44, 17 October 2011

Maybe it was needed by an older PHP Version? We would need to check that.

Seems fine with my Mac PHP 5.3.6

Status & tagging log