diff --git a/build/hintrc.js b/build/hintrc.js index d05d406ac..ce23a0b85 100644 --- a/build/hintrc.js +++ b/build/hintrc.js @@ -18,7 +18,7 @@ exports.config = { "eqnull": false, "evil": false, "expr": false, - "forin": true, + "forin": false, "immed": true, "latedef": true, "loopfunc": false, diff --git a/src/DistanceGrid.js b/src/DistanceGrid.js index 8235c6155..5670c49fc 100644 --- a/src/DistanceGrid.js +++ b/src/DistanceGrid.js @@ -57,20 +57,16 @@ L.DistanceGrid.prototype = { grid = this._grid; for (i in grid) { - if (grid.hasOwnProperty(i)) { - row = grid[i]; + row = grid[i]; - for (j in row) { - if (row.hasOwnProperty(j)) { - cell = row[j]; + for (j in row) { + cell = row[j]; - for (k = 0, len = cell.length; k < len; k++) { - removed = fn.call(context, cell[k]); - if (removed) { - k--; - len--; - } - } + for (k = 0, len = cell.length; k < len; k++) { + removed = fn.call(context, cell[k]); + if (removed) { + k--; + len--; } } } diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 60c48d8ca..f0fd78fd3 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -50,9 +50,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ if (layer instanceof L.LayerGroup) { var array = []; for (var i in layer._layers) { - if (layer._layers.hasOwnProperty(i)) { - array.push(layer._layers[i]); - } + array.push(layer._layers[i]); } return this.addLayers(array); } @@ -149,11 +147,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ //Update the icons of all those visible clusters that were affected for (i in this._layers) { - if (this._layers.hasOwnProperty(i)) { - m = this._layers[i]; - if (m instanceof L.MarkerCluster && m._iconNeedsUpdate) { - m._updateIcon(); - } + m = this._layers[i]; + if (m instanceof L.MarkerCluster && m._iconNeedsUpdate) { + m._updateIcon(); } } @@ -192,11 +188,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds); for (i in this._layers) { - if (this._layers.hasOwnProperty(i)) { - m = this._layers[i]; - if (m instanceof L.MarkerCluster) { - m._updateIcon(); - } + m = this._layers[i]; + if (m instanceof L.MarkerCluster) { + m._updateIcon(); } } @@ -220,9 +214,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ //Remove all the visible layers for (var i in this._layers) { - if (this._layers.hasOwnProperty(i)) { - L.FeatureGroup.prototype.removeLayer.call(this, this._layers[i]); - } + L.FeatureGroup.prototype.removeLayer.call(this, this._layers[i]); } this.eachLayer(function (marker) { @@ -373,9 +365,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ //Clean up all the layers we added to the map for (var i in this._layers) { - if (this._layers.hasOwnProperty(i)) { - L.FeatureGroup.prototype.removeLayer.call(this, this._layers[i]); - } + L.FeatureGroup.prototype.removeLayer.call(this, this._layers[i]); } this._map = null; @@ -789,12 +779,10 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? { me._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel); //TODO Maybe? Update markers in _recursivelyBecomeVisible for (j in me._layers) { - if (me._layers.hasOwnProperty(j)) { - n = me._layers[j]; + n = me._layers[j]; - if (!(n instanceof L.MarkerCluster) && n._icon) { - n.setOpacity(1); - } + if (!(n instanceof L.MarkerCluster) && n._icon) { + n.setOpacity(1); } }