perf: various opts

This commit is contained in:
cha0s 2019-04-17 00:40:18 -05:00
parent d919af7812
commit 63cb41943b
2 changed files with 6 additions and 3 deletions

View File

@ -114,7 +114,8 @@ export class Visible extends decorate(Trait) {
}
else {
let unifiedBoundingBox = [0, 0, 0, 0];
for (const visibleBoundingBox of visibleBoundingBoxes) {
for (let i = 0; i < visibleBoundingBoxes.length; ++i) {
const visibleBoundingBox = visibleBoundingBoxes[i];
unifiedBoundingBox = Rectangle.united(
unifiedBoundingBox,
visibleBoundingBox,

View File

@ -61,7 +61,8 @@ export function Synchronized(Superclass) {
tick(elapsed) {
const children = this.synchronizedChildren();
for (const key of children) {
for (let i = 0; i < children.length; ++i) {
const key = children[i];
if (
'undefined' !== typeof this[key]
&& 'undefined' !== typeof this[key].tick
@ -70,7 +71,8 @@ export function Synchronized(Superclass) {
}
}
this.state = this.state.withMutations((state) => {
for (const key of children) {
for (let i = 0; i < children.length; ++i) {
const key = children[i];
if (
'undefined' !== typeof this[key]
&& 'undefined' !== typeof this[key].state