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
|
|
@ -181,7 +181,8 @@ function editBurg(id) {
|
|||
const basic = group.id === "cities" || group.id === "towns";
|
||||
|
||||
const burgsInGroup = [];
|
||||
for (let i=0; i < group.children.length; i++) {
|
||||
let numberOfChildren = group.children.length;
|
||||
for (let i=0; i < numberOfChildren; i++) {
|
||||
burgsInGroup.push(+group.children[i].dataset.id);
|
||||
}
|
||||
const burgsToRemove = burgsInGroup.filter(b => !pack.burgs[b].capital);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue