Avoid function calls in the loop condition of a for statement
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 24 Jul 2014 15:33:27 +0000 (17:33 +0200)
committerKrinkle <krinklemail@gmail.com>
Thu, 24 Jul 2014 19:45:53 +0000 (19:45 +0000)
Change-Id: I64d9ba96797085b6f54658218404a02d4087ceaf

thumb.php

index 9a4b332..2d7cca7 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -520,7 +520,8 @@ function wfExtractThumbRequestInfo( $thumbRel ) {
        $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/";
        }