import: Use a Set for supported elements

This commit is contained in:
Richard Hansen 2021-03-29 19:40:03 -04:00 committed by webzwo0i
parent e31da37d00
commit 09c349e2a1
2 changed files with 6 additions and 6 deletions

View file

@ -25,7 +25,7 @@ exports.setPadRaw = (padId, r) => {
// get supported block Elements from plugins, we will use this later.
hooks.callAll('ccRegisterBlockElements').forEach((element) => {
supportedElems.push(element);
supportedElems.add(element);
});
Object.keys(records).forEach(async (key) => {
@ -64,7 +64,7 @@ exports.setPadRaw = (padId, r) => {
if (value.pool) {
for (const attrib of Object.keys(value.pool.numToAttrib)) {
const attribName = value.pool.numToAttrib[attrib][0];
if (supportedElems.indexOf(attribName) === -1) {
if (!supportedElems.has(attribName)) {
console.warn('Plugin missing: ' +
`You might want to install a plugin to support this node name: ${attribName}`);
}