perf: tiny opt

This commit is contained in:
cha0s 2019-05-04 13:06:33 -05:00
parent 40eb5867ee
commit 57d6b78dde

View File

@ -84,7 +84,7 @@ export function Synchronized(Superclass) {
}
tick(elapsed) {
for (let i = 0; i < this._childrenWithTickers.length; i++) {
for (let i = 0; i < this._childrenWithTickers.length; ++i) {
const key = this._childrenWithTickers[i];
this[key].tick(elapsed);
}
@ -95,11 +95,11 @@ export function Synchronized(Superclass) {
tickMutateState() {
this.state = this.state.withMutations((state) => {
for (let i = 0; i < this._childrenWithState.length; i++) {
for (let i = 0; i < this._childrenWithState.length; ++i) {
const key = this._childrenWithState[i];
state.set(key, this[key].state);
}
for (let i = 0; i < this._childrenWithoutState.length; i++) {
for (let i = 0; i < this._childrenWithoutState.length; ++i) {
const key = this._childrenWithoutState[i];
state.set(key, this[key]);
}