Optimize slowest patches

This commit is contained in:
Nuckyz 2024-05-23 21:48:12 -03:00
parent 1866e4d379
commit 8f59cd8a1a
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
14 changed files with 33 additions and 33 deletions

View file

@ -111,8 +111,8 @@ export default definePlugin({
{ // Load menu TOC eagerly
find: "Messages.USER_SETTINGS_WITH_BUILD_OVERRIDE.format",
replacement: {
match: /(?<=(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?openContextMenuLazy.{0,100}?(await Promise\.all[^};]*?\)\)).*?,)(?=\1\(this)/,
replace: "(async ()=>$2)(),"
match: /(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?openContextMenuLazy.{0,100}?(await Promise\.all[^};]*?\)\)).*?,(?=\1\(this)/,
replace: "$&(async ()=>$2)(),"
},
predicate: () => settings.store.eagerLoad
},