Skip to content

Commit 2be96fa

Browse files
authored
Update BuildingShapeUtils.js
1 parent 3beb723 commit 2be96fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/extras/BuildingShapeUtils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ class BuildingShapeUtils extends ShapeUtils {
6161
if (BuildingShapeUtils.isClosed(way)){
6262
nodes.pop();
6363
}
64-
const refs = [];
64+
const refs = new Set();
6565
for (let i = 0; i < nodes.length - 1; i++) {
66-
if (refs.includes(nodes[i].getAttribute('ref'))){
66+
if (refs.has(nodes[i].getAttribute('ref'))){
6767
return true;
6868
}
69-
refs.push(nodes[i].getAttribute('ref'));
69+
refs.add(nodes[i].getAttribute('ref'));
7070
}
7171
return false;
7272
}

0 commit comments

Comments
 (0)