r64743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64742‎ | r64743 | r64744 >
Date:10:55, 8 April 2010
Author:svip
Status:deferred
Tags:
Comment:
Up on r64742, using array_slice instead of array_pop. :P
Modified paths:
  • /trunk/extensions/NaturalLanguageList/NaturalLanguageList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NaturalLanguageList/NaturalLanguageList.php
@@ -205,15 +205,11 @@
206206
207207 # Remove anything over the set length, if set
208208 if ( $this->mOptions['length'] != -1
209 - && count( $this->mParams ) > $this->mOptions['length'] ) {
210 - while ( count( $this->mParams ) > $this->mOptions['length'] )
211 - array_pop ( $this->mParams );
212 - }
 209+ && count( $this->mParams ) > $this->mOptions['length'] )
 210+ $this->mParams = array_slice( $this->mParams, 0, $this->mOptions['length'] );
213211
214212 # Remove anything over the allowed limit
215 - while ( count( $this->mParams ) > $wgNllMaxListLength ) {
216 - array_pop( $this->mParams );
217 - }
 213+ $this->mParams = array_slice( $this->mParams, 0, $wgNllMaxListLength );
218214 }
219215
220216 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64742Following up on r64739 and r64740; adding a global parameter to prevent crea...svip10:44, 8 April 2010

Status & tagging log