Introduce some logical assignment in the src/core/ folder

This commit is contained in:
Jonas Jenwald 2022-07-17 11:24:05 +02:00
parent 317abd6d07
commit d950b91c4e
20 changed files with 62 additions and 103 deletions

View file

@ -366,13 +366,10 @@ const getB = (function getBClosure() {
}
return lut;
}
const cache = [];
const cache = Object.create(null);
return function (count) {
if (!cache[count]) {
cache[count] = buildB(count);
}
return cache[count];
return (cache[count] ||= buildB(count));
};
})();