diff --git a/Engines/Wine/Plugins/override DLL/script.js b/Engines/Wine/Plugins/override DLL/script.js index 7331d21972..6be4e51098 100644 --- a/Engines/Wine/Plugins/override DLL/script.js +++ b/Engines/Wine/Plugins/override DLL/script.js @@ -3,11 +3,11 @@ const Regedit = include("engines.wine.plugins.regedit"); module.default = class OverrideDLL { constructor(wine) { this.wine = wine; - this.modes = {}; + this.modes = new Map(); } withMode(mode, libraries) { - this.modes[mode] = libraries; + this.modes.set(mode, libraries); return this; } @@ -15,11 +15,9 @@ module.default = class OverrideDLL { go() { let regeditFileContent = `REGEDIT4\n\n[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides]\n`; - Object.entries(this.modes) - .map(([mode, libraries]) => libraries.map(library => [library, mode])) - .forEach(([library, mode]) => { - regeditFileContent += `"*${library}"="${mode}"\n`; - }); + this.modes.forEach((libraries, mode) => + libraries.forEach(library => regeditFileContent += `"*${library}"="${mode}"\n`) + ); new Regedit(this.wine).patch(regeditFileContent); }