Merge "Avoid function calls in the loop condition of a for statement"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 24 Jul 2014 19:51:16 +0000 (19:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 24 Jul 2014 19:51:16 +0000 (19:51 +0000)
1  2 
thumb.php

diff --combined thumb.php
+++ b/thumb.php
@@@ -388,8 -388,7 +388,8 @@@ function wfGenerateThumbnail( File $fil
        $errorHtml = false;
  
        // guard thumbnail rendering with PoolCounter to avoid stampedes
 -      // expensive files use a separate PoolCounter config so it is possible to set up a global limit on them
 +      // expensive files use a separate PoolCounter config so it is possible
 +      // to set up a global limit on them
        if ( $file->isExpensiveToThumbnail() ) {
                $poolCounterType = 'FileRenderExpensive';
        } else {
@@@ -521,7 -520,8 +521,8 @@@ function wfExtractThumbRequestInfo( $th
        $repo = RepoGroup::singleton()->getLocalRepo();
  
        $hashDirReg = $subdirReg = '';
-       for ( $i = 0; $i < $repo->getHashLevels(); $i++ ) {
+       $hashLevels = $repo->getHashLevels();
+       for ( $i = 0; $i < $hashLevels; $i++ ) {
                $subdirReg .= '[0-9a-f]';
                $hashDirReg .= "$subdirReg/";
        }