Page MenuHomePhabricator

Redundant cache expiration check in Language::loadLocalisation
Closed, ResolvedPublic

Description

Author: ezyang

Description:
When performing cache checks for localization files, both
self::isLocalisationOutOfDate( $cache ) and a foreach loop comparing filemtime
of the dependencies are done. This appears to be redundant, as
isLocalisationOutOfDate appears to do the same process, and the $expired
variable does not appear to be used.

If they are not actually redundant, recommend adding a comment as to the
function of the code block. I do not have a working memcached extension so I
cannot say.

The discrepancy manifested in trunk on r15823 when Tim Starling merged in the
localisation-work branch. The switch to the isLocalisationOutOfDate appeared to
have happened r15804, and replaced the $expired variable, strongly suggesting
that yes, this was an oversight on Tim Starling's part.

http://svn.wikimedia.org/viewvc/mediawiki/branches/localisation-work/phase3/languages/Language.php?view=diff&r1=15803&r2=15804

It is unlikely that this has caused significant performance degradation.

Patch forthcoming.


Version: 1.8.x
Severity: minor
OS: Windows XP
Platform: PC

Details

Reference
bz7973

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:26 PM
bzimport set Reference to bz7973.
bzimport added a subscriber: Unknown Object (MLST).

ezyang wrote:

Removes redundant code

Patch that removes the redundant code

Attached:

hashar added a comment.Jan 4 2007, 8:36 PM

blocks #700 : code quality