chore: perf

This commit is contained in:
cha0s 2021-02-11 18:08:03 -06:00
parent 6b7405c90f
commit de5b9360ae

View File

@ -1,4 +1,4 @@
import {compile, Context} from '@avocado/behavior';
import {compile} from '@avocado/behavior';
import {compose, EventEmitter} from '@latus/core';
import {QuadTree, Rectangle} from '@avocado/math';
import {JsonResource} from '@avocado/resource';
@ -178,12 +178,10 @@ export default (latus) => class EntityList extends decorate(JsonResource) {
const check = compile(condition, latus);
const candidates = this.visibleEntities(query, true);
const fails = [];
const tempContext = new Context({}, latus);
for (let i = 0; i < candidates.length; ++i) {
const entity = candidates[i];
tempContext.map = new Map(context.map);
tempContext.add('query', entity);
if (!check(tempContext)) {
context.add('query', entity);
if (!check(context)) {
fails.push(entity);
}
}