Opened 3 years ago

Last modified 2 years ago

#5979 new enhancement

Don't initialise null values in components. — at Initial Version

Reported by: Freagarach Owned by:
Priority: Should Have Milestone: Backlog
Component: Simulation Keywords: simple
Cc: Patch:

Description

In many JS components there are a lot of variables created on init that are not strictly necessary.

E.g. in ResourceGatherer: this.lastCarriedType = undefined;.

There are more such examples of which some can have more effect on performance. It would be good to not initialise such values, but create them when needed and delete them when not needed anymore. This saves time on init and serialisation data during a game. (Refs. #3834.)

Change History (0)

Note: See TracTickets for help on using tickets.