Remove goog.isNull in style classes

This commit is contained in:
Marc Jansen
2015-09-29 15:21:02 +02:00
parent e1f477ad8c
commit f9b07991e1
7 changed files with 53 additions and 56 deletions
+7 -9
View File
@@ -97,13 +97,12 @@ ol.style.AtlasManager.prototype.getInfo = function(id) {
/** @type {?ol.style.AtlasInfo} */
var info = this.getInfo_(this.atlases_, id);
if (goog.isNull(info)) {
if (!info) {
return null;
}
/** @type {?ol.style.AtlasInfo} */
var hitInfo = this.getInfo_(this.hitAtlases_, id);
goog.asserts.assert(!goog.isNull(hitInfo),
'hitInfo must not be null');
goog.asserts.assert(hitInfo, 'hitInfo must not be null');
return this.mergeInfos_(info, hitInfo);
};
@@ -121,7 +120,7 @@ ol.style.AtlasManager.prototype.getInfo_ = function(atlases, id) {
for (i = 0, ii = atlases.length; i < ii; ++i) {
atlas = atlases[i];
info = atlas.get(id);
if (!goog.isNull(info)) {
if (info) {
return info;
}
}
@@ -184,7 +183,7 @@ ol.style.AtlasManager.prototype.add =
/** @type {?ol.style.AtlasInfo} */
var info = this.add_(false,
id, width, height, renderCallback, opt_this);
if (goog.isNull(info)) {
if (!info) {
return null;
}
@@ -197,8 +196,7 @@ ol.style.AtlasManager.prototype.add =
/** @type {?ol.style.AtlasInfo} */
var hitInfo = this.add_(true,
id, width, height, renderHitCallback, opt_this);
goog.asserts.assert(!goog.isNull(hitInfo),
'hitInfo must not be null');
goog.asserts.assert(hitInfo, 'hitInfo must not be null');
return this.mergeInfos_(info, hitInfo);
};
@@ -225,9 +223,9 @@ ol.style.AtlasManager.prototype.add_ =
for (i = 0, ii = atlases.length; i < ii; ++i) {
atlas = atlases[i];
info = atlas.add(id, width, height, renderCallback, opt_this);
if (!goog.isNull(info)) {
if (info) {
return info;
} else if (goog.isNull(info) && i === ii - 1) {
} else if (!info && i === ii - 1) {
// the entry could not be added to one of the existing atlases,
// create a new atlas that is twice as big and try to add to this one.
var size;