Page MenuHomeWildfire Games

Use Array.from intead of the spread operator
AbandonedPublic

Authored by elexis on Dec 9 2017, 7:25 PM.

Details

Summary

Seems just a tiny bit cleaner.

Test Plan

It's functional if the AI can still order its units. I should test for performance before committing. Perhaps its much faster (like we noticed in some other commit).

Event Timeline

elexis created this revision.Dec 9 2017, 7:25 PM
Vulcan added a subscriber: Vulcan.Dec 9 2017, 7:27 PM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Vulcan added a comment.Dec 9 2017, 7:27 PM
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/common-api/entitycollection.js
|  41| »   »   this._filters.push(eval(f));
|    | [NORMAL] JSHintBear:
|    | eval can be harmful.
mimo added a subscriber: mimo.Dec 16 2017, 5:36 PM

Agreed, more readable and faster according to my tests. I'll commit it with some additions.