From 94741ec06f7e8390db60c4b01481c687df7c82a2 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Wed, 20 Feb 2019 23:40:47 -0800 Subject: [PATCH] Fixed off by one mentioned in #216 --- demo/benchmark/loadrom.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/demo/benchmark/loadrom.js b/demo/benchmark/loadrom.js index 9e7e0ef8..20752103 100644 --- a/demo/benchmark/loadrom.js +++ b/demo/benchmark/loadrom.js @@ -69,9 +69,8 @@ export default class LoadROMSelector extends Component { // Clear Wasm memory // https://docs.google.com/spreadsheets/d/17xrEzJk5-sCB9J2mMJcVnzhbE-XH_NvczVSQH9OHvRk/edit?usp=sharing coreObjects.forEach(coreObject => { - for (let i = 0; i <= coreObject.core.byteMemory.length; i++) { - coreObject.core.byteMemory[i] = 0; - } + // Reset the byte memory to zero at all indexes + coreObject.core.byteMemory.fill(0); // Set the ROM in byte memory coreObject.core.byteMemory.set(ROMObject.ROM, coreObject.core.instance.exports.CARTRIDGE_ROM_LOCATION);