r111310 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111309‎ | r111310 | r111311 >
Date:17:47, 12 February 2012
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Useless wrapping on an anonymous function. Follow-up r111264
Modified paths:
  • /trunk/phase3/includes/DBDataObject.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DBDataObject.php
@@ -895,7 +895,7 @@
896896
897897 if ( $collapse ) {
898898 if ( count( $fields ) === 1 ) {
899 - $objects = array_map( function( $object ) { return array_shift( $object ); } , $objects );
 899+ $objects = array_map( 'array_shift', $objects );
900900 }
901901 elseif ( count( $fields ) === 2 ) {
902902 $o = array();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111264adding DBDataObject class after having some people review it and posting on t...jeroendedauw21:34, 11 February 2012

Comments

#Comment by Platonides (talk | contribs)   17:57, 12 February 2012

The anonymous function had a little difference, as it receives $object by value, and array_shift by reference but:

  • Testing shows that array_map('array_shift', $foo) doesn't modify $foo
  • We are overwriting $objects anyway.

Status & tagging log