From: Ævar Arnfjörð Bjarmason Date: Tue, 16 Aug 2005 13:03:46 +0000 (+0000) Subject: * Cut down on the time the redundant() function takes, not takes ~2sec but took X-Git-Tag: 1.6.0~1942 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=dc3384b76fdbab5be5f3c3326e00cc1a8666c0bf;p=lhc%2Fweb%2Fwiklou.git * Cut down on the time the redundant() function takes, not takes ~2sec but took ~1min before. --- diff --git a/maintenance/transstat.php b/maintenance/transstat.php index d49d21e50c..b042944157 100644 --- a/maintenance/transstat.php +++ b/maintenance/transstat.php @@ -30,9 +30,6 @@ Usage: php transstat.php [--help] [--output:csv|text|wiki] [--noredundant] * 'wiki' : MediaWiki syntax. * 'text' : Text with tabs. Default output is 'wiki' - --noredundant : do NOT calculate redundant (takes some time) - - END; } @@ -104,20 +101,15 @@ class csvStatsOutput extends statsOutput { } -/** FIXME: This takes an obscene amount of time */ -if(isset($options['noredundant'])) { - function redundant(&$arr) { return 'NC'; } -} else { - function redundant(&$arr) { - global $wgAllMessagesEn; - - $redundant = 0; - foreach(array_keys($arr) as $key) { - if ( ! array_key_exists( $key, $wgAllMessagesEn) ) - ++$redundant; - } - return $redundant; +function redundant(&$arr) { + global $wgAllMessagesEn; + + $redundant = 0; + foreach(array_keys($arr) as $key) { + if ( @$wgAllMessagesEn[$key] === null ) + ++$redundant; } + return $redundant; } // Select an output engine