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
|
|
@ -138,7 +138,8 @@ function inlineStyle(clone) {
|
|||
const compStyle = window.getComputedStyle(this);
|
||||
let style = "";
|
||||
|
||||
for (let i=0; i < compStyle.length; i++) {
|
||||
let compStyleLength = compStyle.length;
|
||||
for (let i=0; i < compStyleLength; i++) {
|
||||
const key = compStyle[i];
|
||||
const value = compStyle.getPropertyValue(key);
|
||||
|
||||
|
|
@ -602,7 +603,8 @@ function parseLoadedData(data) {
|
|||
biomesData.name = biomes[2].split(",");
|
||||
|
||||
// push custom biomes if any
|
||||
for (let i=biomesData.i.length; i < biomesData.name.length; i++) {
|
||||
let biomeNamesLength = biomesData.name.length;
|
||||
for (let i=biomesData.i.length; i < biomeNamesLength; i++) {
|
||||
biomesData.i.push(biomesData.i.length);
|
||||
biomesData.iconsDensity.push(0);
|
||||
biomesData.icons.push([]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue