User "Dantman" posted a comment on MediaWiki.r93654.

Full URL: 
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/93654#c20580
Commit summary:

Follows-up r93515 CR: Whitespace

Comment:

I don't see a good reason why you even need two vars in that var statement, 
<var>regItemDepLen</var> makes more sense being defined along with <var>n</var> 
as they're both only used within the context of that for loop.
<source lang=javascript>
var regItemDeps = registry[dependencies[0]].dependencies;
for ( var n = 0, regItemDepLen = regItemDeps.length; n < regItemDepLen; n++ ) {
        dependencies.push(regItemDeps[n]);
}
</source>

Though I've already mentioned how while awkwardly phrased, JS already has the 
functionality to append an array onto the end of another array without doing an 
inefficient loop like this in the first place.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to