r77712 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77711‎ | r77712 | r77713 >
Date:08:58, 4 December 2010
Author:hashar
Status:ok
Tags:
Comment:
Max command length using one line of code

Follow-up r76621 code review
Modified paths:
  • /trunk/phase3/maintenance/mcc.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mcc.php
@@ -31,10 +31,7 @@
3232 $command = 'fullhelp';
3333 }
3434 if ( $command === 'fullhelp' ) {
35 - $max_cmd_len = 0;
36 - foreach( array_keys( $commandList ) as $cmd ) {
37 - $max_cmd_len = max( $max_cmd_len, strlen($cmd) );
38 - }
 35+ $max_cmd_len = max( array_map( 'strlen', array_keys( $commandList ) ) );
3936 foreach ( $commandList as $cmd => $desc ) {
4037 printf( "%-{$max_cmd_len}s: %s\n", $cmd, $desc );
4138 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76621justify help memcached console helphashar10:33, 13 November 2010

Status & tagging log