Skip to content

Commit b8e0b53

Browse files
Remove unnecessary init dance.
We already precompile the WASM.
1 parent 94d5256 commit b8e0b53

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/board/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export class Board {
7777
return result ?? id;
7878
};
7979

80-
private initialModulePromise: Promise<ModuleWrapper> | undefined;
8180
/**
8281
* Defined during start().
8382
*/
@@ -92,9 +91,6 @@ export class Board {
9291
private fs: FileSystem,
9392
private svg: SVGElement
9493
) {
95-
// We start this loading here so as not to delay loading WASM until start().
96-
this.initialModulePromise = this.createModule();
97-
9894
this.display = new Display(
9995
Array.from(this.svg.querySelector("#LEDsOn")!.querySelectorAll("use"))
10096
);
@@ -320,14 +316,8 @@ export class Board {
320316
if (this.modulePromise) {
321317
throw new Error("Module already exists!");
322318
}
323-
// Use the pre-loaded one the first time through.
324-
if (this.initialModulePromise) {
325-
this.modulePromise = this.initialModulePromise;
326-
this.initialModulePromise = undefined;
327-
} else {
328-
this.modulePromise = this.createModule();
329-
}
330319

320+
this.modulePromise = this.createModule();
331321
const module = await this.modulePromise;
332322
let panicCode: number | undefined;
333323
try {

0 commit comments

Comments
 (0)