From 0bdd807d9d027fc418aef59b768b3f1c56f27ed9 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 8 Aug 2023 11:05:33 +0200 Subject: [PATCH] Cleaned code according to comments in PR --- src/tiledimage.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index 869d3633..0bedb701 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1437,7 +1437,6 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag } } - this._sortTiles(best); return best; }, @@ -1931,8 +1930,8 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag return [tile]; } previousBest.push(tile); + this._sortTiles(previousBest); if (previousBest.length > maxNTiles) { - this._sortTiles(previousBest); previousBest.pop(); } return previousBest;