Remove unnecessary cast

Found by the latest version of closure-compiler (v20150729)
This commit is contained in:
Frederic Junod
2015-08-31 11:43:30 +02:00
parent 965a27b115
commit 529f869803
6 changed files with 7 additions and 18 deletions

View File

@@ -302,13 +302,10 @@ ol.FeatureStyleFunction;
* @return {ol.FeatureStyleFunction} A style function.
*/
ol.Feature.createStyleFunction = function(obj) {
/**
* @type {ol.FeatureStyleFunction}
*/
var styleFunction;
if (goog.isFunction(obj)) {
styleFunction = /** @type {ol.FeatureStyleFunction} */ (obj);
styleFunction = obj;
} else {
/**
* @type {Array.<ol.style.Style>}

View File

@@ -291,8 +291,7 @@ ol.format.TopoJSON.prototype.readFeaturesFromObject = function(
var topoJSONTopology = /** @type {TopoJSONTopology} */ (object);
var transform, scale = null, translate = null;
if (goog.isDef(topoJSONTopology.transform)) {
transform = /** @type {TopoJSONTransform} */
(topoJSONTopology.transform);
transform = topoJSONTopology.transform;
scale = transform.scale;
translate = transform.translate;
}

View File

@@ -393,9 +393,7 @@ ol.renderer.webgl.Map.prototype.handleWebGLContextLost = function(event) {
function(layerRenderer, key, object) {
goog.asserts.assertInstanceof(layerRenderer, ol.renderer.webgl.Layer,
'renderer is an instance of ol.renderer.webgl.Layer');
var webGLLayerRenderer = /** @type {ol.renderer.webgl.Layer} */
(layerRenderer);
webGLLayerRenderer.handleWebGLContextLost();
layerRenderer.handleWebGLContextLost();
});
};

View File

@@ -429,11 +429,9 @@ ol.source.Raster.createRenderers_ = function(sources) {
ol.source.Raster.createRenderer_ = function(source) {
var renderer = null;
if (source instanceof ol.source.Tile) {
renderer = ol.source.Raster.createTileRenderer_(
/** @type {ol.source.Tile} */ (source));
renderer = ol.source.Raster.createTileRenderer_(source);
} else if (source instanceof ol.source.Image) {
renderer = ol.source.Raster.createImageRenderer_(
/** @type {ol.source.Image} */ (source));
renderer = ol.source.Raster.createImageRenderer_(source);
} else {
goog.asserts.fail('Unsupported source type: ' + source);
}

View File

@@ -214,13 +214,10 @@ ol.style.StyleFunction;
* @return {ol.style.StyleFunction} A style function.
*/
ol.style.createStyleFunction = function(obj) {
/**
* @type {ol.style.StyleFunction}
*/
var styleFunction;
if (goog.isFunction(obj)) {
styleFunction = /** @type {ol.style.StyleFunction} */ (obj);
styleFunction = obj;
} else {
/**
* @type {Array.<ol.style.Style>}

View File

@@ -42,7 +42,7 @@ ol.TileCache.prototype.canExpireCache = function() {
ol.TileCache.prototype.expireCache = function(usedTiles) {
var tile, zKey;
while (this.canExpireCache()) {
tile = /** @type {ol.Tile} */ (this.peekLast());
tile = this.peekLast();
zKey = tile.tileCoord[0].toString();
if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) {
break;