mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 12:01:23 +01:00
Optimized Reused Values for Loops
This commit is contained in:
parent
8ec42ca2e5
commit
234fcb09c2
19 changed files with 91 additions and 54 deletions
|
|
@ -66,7 +66,8 @@
|
|||
|
||||
// Define grid ocean cells type based on distance form land
|
||||
function markupOcean(limits) {
|
||||
for (let t = -2; t >= limits[0]-1; t--) {
|
||||
let limits0 = limits[0];
|
||||
for (let t = -2; t >= limits0-1; t--) {
|
||||
for (let i = 0; i < pointsN; i++) {
|
||||
if (cells.t[i] !== t+1) continue;
|
||||
cells.c[i].forEach(function(e) {if (!cells.t[e]) cells.t[e] = t;});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue