Caching array length instead of accessing it with each iteration. r=crschmidt (closes #1636)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7627 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -266,7 +266,7 @@ OpenLayers.Format.JSON = OpenLayers.Class(OpenLayers.Format, {
|
||||
var pieces = ['['];
|
||||
this.level += 1;
|
||||
|
||||
for(var i=0; i<array.length; ++i) {
|
||||
for(var i=0, len=array.length; i<len; ++i) {
|
||||
// recursive calls need to allow for sub-classing
|
||||
json = OpenLayers.Format.JSON.prototype.write.apply(this,
|
||||
[array[i], this.pretty]);
|
||||
|
||||
Reference in New Issue
Block a user