From 12875f1d68a6988bbec5b08b0f638e82c8100b93 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 15 Dec 2018 01:41:00 -0400 Subject: Get rid of unnecessary map() call This doesn't impact performance noticeably, it's just a code nitpick. --- ui.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ui.js b/ui.js index b055990..41fcf74 100644 --- a/ui.js +++ b/ui.js @@ -834,11 +834,8 @@ class GrouplikeListingElement extends Form { } if (this.grouplike.items.length) { - const itemElements = this.grouplike.items.map(item => { - return new InteractiveGrouplikeItemElement(item, this.recordStore) - }) - - for (const itemElement of itemElements) { + for (const item of this.grouplike.items) { + const itemElement = new InteractiveGrouplikeItemElement(item, this.recordStore) for (const evtName of ['download', 'remove', 'mark', 'paste', 'browse', 'queue', 'unqueue', 'menu']) { itemElement.on(evtName, (...data) => this.emit(evtName, itemElement.item, ...data)) } -- cgit 1.3.0-6-gf8a5