Skip to content

Commit cd60934

Browse files
authored
[webgpu] Remove redundant check in initManagers. NFC (#22704)
initManagers already has a reentrancey check at the top (which itself I believe in not necessary).
1 parent 2432911 commit cd60934

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/library_webgpu.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
// Helper functions for code generation
3131
globalThis.gpu = {
3232
makeInitManager: function(type) {
33-
var mgr = `WebGPU.mgr${type}`;
34-
return `${mgr} = ${mgr} || new Manager();`;
33+
return `WebGPU.mgr${type} = new Manager();`;
3534
},
3635

3736
makeReferenceRelease: function(type) {
@@ -201,7 +200,9 @@ var LibraryWebGPU = {
201200
},
202201

203202
initManagers: () => {
204-
if (WebGPU.mgrDevice) return;
203+
#if ASSERTIONS
204+
assert(!WebGPU.mgrDevice, 'initManagers already called');
205+
#endif
205206

206207
/** @constructor */
207208
function Manager() {

0 commit comments

Comments
 (0)