Remove dead code path from getCached

There was a code path that handled the case where getCached was not
passed the `CacheType` parameter. However, all call sites *do* pass that
parameter, and the JSDoc indicates that the parameter is required.
This commit is contained in:
adroitwhiz 2021-03-04 00:43:20 -05:00
parent f38ee90a9d
commit 002cddf620

View file

@ -1234,23 +1234,13 @@ BlocksExecuteCache.getCached = function (blocks, blockId, CacheType) {
const block = blocks.getBlock(blockId);
if (typeof block === 'undefined') return null;
if (typeof CacheType === 'undefined') {
cached = {
id: blockId,
opcode: blocks.getOpcode(block),
fields: blocks.getFields(block),
inputs: blocks.getInputs(block),
mutation: blocks.getMutation(block)
};
} else {
cached = new CacheType(blocks, {
id: blockId,
opcode: blocks.getOpcode(block),
fields: blocks.getFields(block),
inputs: blocks.getInputs(block),
mutation: blocks.getMutation(block)
});
}
cached = new CacheType(blocks, {
id: blockId,
opcode: blocks.getOpcode(block),
fields: blocks.getFields(block),
inputs: blocks.getInputs(block),
mutation: blocks.getMutation(block)
});
blocks._cache._executeCached[blockId] = cached;
return cached;