From 8c1fd3b6e46b7adfa9fdbe24a51619302cacacfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Wed, 15 Sep 2021 22:38:46 +0200 Subject: [PATCH] Cleanup --- modules/submap.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/submap.js b/modules/submap.js index b95369cb..45faa942 100644 --- a/modules/submap.js +++ b/modules/submap.js @@ -135,8 +135,6 @@ window.Submap = (function () { cells.province = new Uint16Array(pn); stage("Resampling culture, state and religion map.") - - for(const [id, gridCellId] of cells.g.entries()) { const oldGridId = reverseGridMap[gridCellId]; if (!oldGridId) throw new Error("Old grid Id must be defined!") @@ -164,7 +162,7 @@ window.Submap = (function () { const distance = x => (x[0]-cells.p[id][0])**2 + (x[1]-cells.p[id][1])**2; let d = Infinity; oldChildren.forEach(oid => { - // must be the same type (it should be always true!) + // must be the same type (this should be always true!) if (isWater(oldCells.t[oid]) !== isWater(cells.t[id])) { console.error( "should be the same", oid, id, oldCells.t[oid], cells.t[id], @@ -290,7 +288,7 @@ window.Submap = (function () { * returns [cellid, neighbor] tuple or undefined if no such cell. */ const findNearest = (f, max=3) => centerId => { - const met = new Set([centerId]); // f might be expensive + const met = new Set([centerId]); // cache, f might be expensive const kernel = (c, dist) => { const ncs = pack.cells.c[c].filter(nc => !met.has(nc)); const n = ncs.find(f); @@ -305,8 +303,7 @@ window.Submap = (function () { } function copyBurgs(parentMap, projection, options) { - const [[xmin, ymin], [xmax, ymax]] = getViewBoxExtent(); - const inMap = (x,y) => x>xmin && xymin && y x>0 && x0 && y