merge-upstream: remove unnecessary Object.keys usage

might be a tiny bit faster
This commit is contained in:
Muffin committed 2024-01-09 15:16:49 -06:00
1 parent ba101b3ee8
commit 5c1934099e
1 file changed
+3 -3
+3 -3
View File
@@ -66,11 +66,11 @@ class Theme {
/** @readonly */
this.id = ++themeObjectsCreated;
/** @readonly */
this.accent = Object.keys(ACCENT_MAP).includes(accent) ? accent : ACCENT_DEFAULT;
this.accent = Object.prototype.hasOwnProperty.call(ACCENT_MAP, accent) ? accent : ACCENT_DEFAULT;
/** @readonly */
this.gui = Object.keys(GUI_MAP).includes(gui) ? gui : GUI_DEFAULT;
this.gui = Object.prototype.hasOwnProperty.call(GUI_MAP, gui) ? gui : GUI_DEFAULT;
/** @readonly */
this.blocks = Object.keys(BLOCKS_MAP).includes(blocks) ? blocks : BLOCKS_DEFAULT;
this.blocks = Object.prototype.hasOwnProperty.call(BLOCKS_MAP, blocks) ? blocks : BLOCKS_DEFAULT;
}
static light = new Theme(ACCENT_DEFAULT, GUI_LIGHT, BLOCKS_DEFAULT);