chore: perf
This commit is contained in:
parent
6b7405c90f
commit
de5b9360ae
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user