From 42f7288d739612eca4e28bc9474d71d52981921e Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 18 Sep 2013 16:45:48 +0200 Subject: [PATCH 1/2] Assign function instead of calling it --- src/ol/source/tilesource.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ol/source/tilesource.js b/src/ol/source/tilesource.js index e0b7e11f1b..6588072121 100644 --- a/src/ol/source/tilesource.js +++ b/src/ol/source/tilesource.js @@ -111,9 +111,7 @@ ol.source.Tile.prototype.findLoadedTiles = function(loadedTilesByZ, * @return {string} Key. * @protected */ -ol.source.Tile.prototype.getKeyZXY = function(z, x, y) { - return ol.TileCoord.getKeyZXY(z, x, y); -}; +ol.source.Tile.prototype.getKeyZXY = ol.TileCoord.getKeyZXY; /** From e30d0fefb017852877904d3ca49d9d3decc22764 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 18 Sep 2013 17:05:37 +0200 Subject: [PATCH 2/2] Concatenate keys instead of joining it For performances reasons, see http://jsperf.com/array-join-string-concat --- src/ol/tilecoord.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/tilecoord.js b/src/ol/tilecoord.js index 66ce92882d..6ac8dfba10 100644 --- a/src/ol/tilecoord.js +++ b/src/ol/tilecoord.js @@ -109,7 +109,7 @@ ol.TileCoord.createOrUpdate = function(z, x, y, tileCoord) { * @return {string} Key. */ ol.TileCoord.getKeyZXY = function(z, x, y) { - return [z, x, y].join('/'); + return z + '/' + x + '/' + y; };