Remove use of goog.array.isEmpty

This commit is contained in:
Frederic Junod
2015-09-22 11:25:04 +02:00
parent 44b1c9da89
commit 0d23ab44b3
5 changed files with 5 additions and 9 deletions

View File

@@ -108,7 +108,7 @@ ol.control.Control.prototype.setMap = function(map) {
if (!goog.isNull(this.map_)) { if (!goog.isNull(this.map_)) {
goog.dom.removeNode(this.element); goog.dom.removeNode(this.element);
} }
if (!goog.array.isEmpty(this.listenerKeys)) { if (this.listenerKeys.length > 0) {
goog.array.forEach(this.listenerKeys, goog.events.unlistenByKey); goog.array.forEach(this.listenerKeys, goog.events.unlistenByKey);
this.listenerKeys.length = 0; this.listenerKeys.length = 0;
} }

View File

@@ -1,6 +1,5 @@
goog.provide('ol.format.WKT'); goog.provide('ol.format.WKT');
goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('ol.Feature'); goog.require('ol.Feature');
goog.require('ol.format.Feature'); goog.require('ol.format.Feature');
@@ -59,7 +58,7 @@ ol.format.WKT.EMPTY = 'EMPTY';
*/ */
ol.format.WKT.encodePointGeometry_ = function(geom) { ol.format.WKT.encodePointGeometry_ = function(geom) {
var coordinates = geom.getCoordinates(); var coordinates = geom.getCoordinates();
if (goog.array.isEmpty(coordinates)) { if (coordinates.length === 0) {
return ''; return '';
} }
return coordinates[0] + ' ' + coordinates[1]; return coordinates[0] + ' ' + coordinates[1];

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.GeometryCollection'); goog.provide('ol.geom.GeometryCollection');
goog.require('goog.array');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
goog.require('goog.object'); goog.require('goog.object');
@@ -231,7 +230,7 @@ ol.geom.GeometryCollection.prototype.intersectsExtent = function(extent) {
* @return {boolean} Is empty. * @return {boolean} Is empty.
*/ */
ol.geom.GeometryCollection.prototype.isEmpty = function() { ol.geom.GeometryCollection.prototype.isEmpty = function() {
return goog.array.isEmpty(this.geometries_); return this.geometries_.length === 0;
}; };

View File

@@ -1,6 +1,5 @@
goog.provide('ol.source.TileArcGISRest'); goog.provide('ol.source.TileArcGISRest');
goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.math'); goog.require('goog.math');
goog.require('goog.object'); goog.require('goog.object');
@@ -101,7 +100,7 @@ ol.source.TileArcGISRest.prototype.getRequestUrl_ =
pixelRatio, projection, params) { pixelRatio, projection, params) {
var urls = this.urls_; var urls = this.urls_;
if (goog.array.isEmpty(urls)) { if (urls.length === 0) {
return undefined; return undefined;
} }

View File

@@ -4,7 +4,6 @@
goog.provide('ol.source.TileWMS'); goog.provide('ol.source.TileWMS');
goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.math'); goog.require('goog.math');
goog.require('goog.object'); goog.require('goog.object');
@@ -222,7 +221,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ =
pixelRatio, projection, params) { pixelRatio, projection, params) {
var urls = this.urls_; var urls = this.urls_;
if (goog.array.isEmpty(urls)) { if (urls.length === 0) {
return undefined; return undefined;
} }