Remove unnecessary goog.isDefAndNotNull() calls
This commit is contained in:
@@ -96,8 +96,7 @@ ol.render.Box.prototype.disposeInternal = function() {
|
||||
*/
|
||||
ol.render.Box.prototype.handleMapPostCompose_ = function(event) {
|
||||
var geometry = this.geometry_;
|
||||
goog.asserts.assert(goog.isDefAndNotNull(geometry),
|
||||
'geometry should be defined');
|
||||
goog.asserts.assert(geometry, 'geometry should be defined');
|
||||
var style = this.style_;
|
||||
goog.asserts.assert(!goog.isNull(style), 'style should not be null');
|
||||
// use drawAsync(Infinity) to draw above everything
|
||||
|
||||
@@ -480,7 +480,7 @@ ol.render.canvas.Immediate.prototype.drawCircleGeometry =
|
||||
*/
|
||||
ol.render.canvas.Immediate.prototype.drawFeature = function(feature, style) {
|
||||
var geometry = style.getGeometryFunction()(feature);
|
||||
if (!goog.isDefAndNotNull(geometry) ||
|
||||
if (!geometry ||
|
||||
!ol.extent.intersects(this.extent_, geometry.getExtent())) {
|
||||
return;
|
||||
}
|
||||
@@ -874,7 +874,7 @@ ol.render.canvas.Immediate.prototype.setFillStrokeStyle =
|
||||
this.strokeState_ = {
|
||||
lineCap: strokeStyleLineCap !== undefined ?
|
||||
strokeStyleLineCap : ol.render.canvas.defaultLineCap,
|
||||
lineDash: goog.isDefAndNotNull(strokeStyleLineDash) ?
|
||||
lineDash: strokeStyleLineDash ?
|
||||
strokeStyleLineDash : ol.render.canvas.defaultLineDash,
|
||||
lineJoin: strokeStyleLineJoin !== undefined ?
|
||||
strokeStyleLineJoin : ol.render.canvas.defaultLineJoin,
|
||||
@@ -963,7 +963,7 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) {
|
||||
this.textStrokeState_ = {
|
||||
lineCap: textStrokeStyleLineCap !== undefined ?
|
||||
textStrokeStyleLineCap : ol.render.canvas.defaultLineCap,
|
||||
lineDash: goog.isDefAndNotNull(textStrokeStyleLineDash) ?
|
||||
lineDash: textStrokeStyleLineDash ?
|
||||
textStrokeStyleLineDash : ol.render.canvas.defaultLineDash,
|
||||
lineJoin: textStrokeStyleLineJoin !== undefined ?
|
||||
textStrokeStyleLineJoin : ol.render.canvas.defaultLineJoin,
|
||||
|
||||
@@ -259,7 +259,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
||||
feature = /** @type {ol.Feature} */ (instruction[1]);
|
||||
var featureUid = goog.getUid(feature).toString();
|
||||
if (skippedFeaturesHash[featureUid] !== undefined ||
|
||||
!goog.isDefAndNotNull(feature.getGeometry())) {
|
||||
!feature.getGeometry()) {
|
||||
i = /** @type {number} */ (instruction[2]);
|
||||
} else if (opt_hitExtent !== undefined && !ol.extent.intersects(
|
||||
/** @type {Array<number>} */ (opt_hitExtent),
|
||||
@@ -1728,7 +1728,7 @@ ol.render.canvas.TextReplay.prototype.setTextStyle = function(textStyle) {
|
||||
var textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit();
|
||||
var lineCap = textStrokeStyleLineCap !== undefined ?
|
||||
textStrokeStyleLineCap : ol.render.canvas.defaultLineCap;
|
||||
var lineDash = goog.isDefAndNotNull(textStrokeStyleLineDash) ?
|
||||
var lineDash = textStrokeStyleLineDash ?
|
||||
textStrokeStyleLineDash.slice() : ol.render.canvas.defaultLineDash;
|
||||
var lineJoin = textStrokeStyleLineJoin !== undefined ?
|
||||
textStrokeStyleLineJoin : ol.render.canvas.defaultLineJoin;
|
||||
|
||||
@@ -126,7 +126,7 @@ ol.render.webgl.Immediate.prototype.drawCircleGeometry =
|
||||
*/
|
||||
ol.render.webgl.Immediate.prototype.drawFeature = function(feature, style) {
|
||||
var geometry = style.getGeometryFunction()(feature);
|
||||
if (!goog.isDefAndNotNull(geometry) ||
|
||||
if (!geometry ||
|
||||
!ol.extent.intersects(this.extent_, geometry.getExtent())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -821,7 +821,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayOneByOne_ =
|
||||
featureUid = goog.getUid(feature).toString();
|
||||
|
||||
if (skippedFeaturesHash[featureUid] === undefined &&
|
||||
goog.isDefAndNotNull(feature.getGeometry()) &&
|
||||
feature.getGeometry() &&
|
||||
(opt_hitExtent === undefined || ol.extent.intersects(
|
||||
/** @type {Array<number>} */ (opt_hitExtent),
|
||||
feature.getGeometry().getExtent()))) {
|
||||
|
||||
Reference in New Issue
Block a user