perf: tiny opt
This commit is contained in:
parent
40eb5867ee
commit
57d6b78dde
|
@ -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]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user