From c8e9525f3b14e01184b17379c5951529d7a842df Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 18 Sep 2015 14:51:24 +0900 Subject: [PATCH] Remove goog.isDef from attribution.js through color.js (-54 B) --- src/ol/attribution.js | 3 +-- src/ol/centerconstraint.js | 2 +- src/ol/collection.js | 2 +- src/ol/color/color.js | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ol/attribution.js b/src/ol/attribution.js index 8a449b1a20..11a4188f4c 100644 --- a/src/ol/attribution.js +++ b/src/ol/attribution.js @@ -38,8 +38,7 @@ ol.Attribution = function(options) { * @private * @type {Object.>} */ - this.tileRanges_ = goog.isDef(options.tileRanges) ? - options.tileRanges : null; + this.tileRanges_ = options.tileRanges ? options.tileRanges : null; }; diff --git a/src/ol/centerconstraint.js b/src/ol/centerconstraint.js index 2cc4db9592..e67c91082d 100644 --- a/src/ol/centerconstraint.js +++ b/src/ol/centerconstraint.js @@ -21,7 +21,7 @@ ol.CenterConstraint.createExtent = function(extent) { * @return {ol.Coordinate|undefined} Center. */ function(center) { - if (goog.isDef(center)) { + if (center) { return [ goog.math.clamp(center[0], extent[0], extent[2]), goog.math.clamp(center[1], extent[1], extent[3]) diff --git a/src/ol/collection.js b/src/ol/collection.js index a679dca011..2da288fac9 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -91,7 +91,7 @@ ol.Collection = function(opt_array) { * @private * @type {!Array.} */ - this.array_ = goog.isDef(opt_array) ? opt_array : []; + this.array_ = opt_array ? opt_array : []; this.updateLength_(); diff --git a/src/ol/color/color.js b/src/ol/color/color.js index ecb2cbae21..98f8cf6abb 100644 --- a/src/ol/color/color.js +++ b/src/ol/color/color.js @@ -62,7 +62,7 @@ ol.color.rgbaColorRe_ = ol.color.blend = function(dst, src, opt_color) { // http://en.wikipedia.org/wiki/Alpha_compositing // FIXME do we need to scale by 255? - var out = goog.isDef(opt_color) ? opt_color : []; + var out = opt_color ? opt_color : []; var dstA = dst[3]; var srcA = src[3]; if (dstA == 1) { @@ -271,7 +271,7 @@ ol.color.isValid = function(color) { * @return {ol.Color} Clamped color. */ ol.color.normalize = function(color, opt_color) { - var result = goog.isDef(opt_color) ? opt_color : []; + var result = opt_color ? opt_color : []; result[0] = goog.math.clamp((color[0] + 0.5) | 0, 0, 255); result[1] = goog.math.clamp((color[1] + 0.5) | 0, 0, 255); result[2] = goog.math.clamp((color[2] + 0.5) | 0, 0, 255); @@ -309,7 +309,7 @@ ol.color.toString = function(color) { * @return {ol.Color} Transformed color. */ ol.color.transform = function(color, transform, opt_color) { - var result = goog.isDef(opt_color) ? opt_color : []; + var result = opt_color ? opt_color : []; result = goog.vec.Mat4.multVec3(transform, color, result); goog.asserts.assert(goog.isArray(result), 'result should be an array'); result[3] = color[3];