r70469 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70468‎ | r70469 | r70470 >
Date:17:48, 4 August 2010
Author:tparscal
Status:ok
Tags:
Comment:
Converted more uses of for ( index in object ) {} on non-associative objects to for ( i; i < length; i++ ) {} - improving on r70220.
Modified paths:
  • /branches/resourceloader/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/resources/mediawiki/mediawiki.js
@@ -84,7 +84,7 @@
8585 this.get = function( keys, fallback ) {
8686 if ( typeof keys === 'object' ) {
8787 var result = {};
88 - for ( var k in keys ) {
 88+ for ( var k = 0; k < keys.length; k++ ) {
8989 if ( typeof values[keys[k]] !== 'undefined' ) {
9090 result[keys[k]] = values[keys[k]];
9191 }
@@ -101,7 +101,7 @@
102102 */
103103 this.exists = function( keys ) {
104104 if ( typeof keys === 'object' ) {
105 - for ( var k in keys ) {
 105+ for ( var k = 0; k < keys.length; k++ ) {
106106 if ( !( keys[k] in values ) ) {
107107 return false;
108108 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70220Moved jquery-1.4.2 to jquery, added jquery-ui and some themes. Refactored mw....tparscal17:10, 31 July 2010

Status & tagging log