HomeWildfire Games

Use Array.from intead of the spread operator (that's more readable and more…
AuditedrP20657

Description

Use Array.from intead of the spread operator (that's more readable and more performant)

Patch by elexis

Reviewed and extended by mimo

Differential Revision: https://code.wildfiregames.com/D1135

Event Timeline

elexis accepted this commit.Dec 16 2017, 5:54 PM
elexis added a subscriber: elexis.
elexis added inline comments.
/ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
903

(D1132 used an array instead of set in entsWithAuraAndStatusBars as it's only used as an array (still the ugly splice+indexOf operation to remove), didn't actually check what's faster)

All concerns with this commit have now been addressed.Dec 16 2017, 5:54 PM
elexis added inline comments.Dec 17 2017, 9:52 PM
/ps/trunk/binaries/data/mods/public/simulation/components/tests/test_VisionSharing.js
54

<nitpick>TS_ASSERT_UNEVAL_EQUALS(cmpVisionSharing.shared, new Set([1]));</nitpick>

mimo added a comment.Dec 18 2017, 6:58 PM

agreed. Done in rP20661