-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Area: Lusk (Skript)Takes place in the 'skript' module. More specifically in the skript implementation.Takes place in the 'skript' module. More specifically in the skript implementation.Good First IssueGood for newcomersGood for newcomersPriority: MediumShould be addressed decently soon,Should be addressed decently soon,Status: PlannedPlanned for implementation. Not waiting on other features or changes to be implemented.Planned for implementation. Not waiting on other features or changes to be implemented.Type: BugSomething isn't workingSomething isn't working
Description
Describe the bug
return boundingBoxExpression.stream(event).flatMap(boundingBox -> entityDataExpression.stream(event).flatMap(entityData -> {
Class<? extends Entity> entityClass = entityData.getType();
Predicate<Entity> filter = entity -> entityClass.isAssignableFrom(entity.getClass());
return worldExpression.stream(event).flatMap(world -> world.getNearbyEntities(boundingBox, filter).stream());
})).toArray(Entity[]::new);
can evaluate entitydata and world expression many multiple times, and could call getNearbyEntities many more times than necessary (it's also rather messy code but that's subjective). (ExprBoundingBoxEntities)
I believe this applies to some other bounding box syntaxes too.
To Reproduce
eval EBBE with multiple bounding boxes or entity datas, see that world expression is evaled many times
Expected behavior
only evaluate expressions once
Screenshots
If applicable, add screenshots to help explain your problem.
/sk info:
N/A
Additional context
Add any other context about the problem here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: Lusk (Skript)Takes place in the 'skript' module. More specifically in the skript implementation.Takes place in the 'skript' module. More specifically in the skript implementation.Good First IssueGood for newcomersGood for newcomersPriority: MediumShould be addressed decently soon,Should be addressed decently soon,Status: PlannedPlanned for implementation. Not waiting on other features or changes to be implemented.Planned for implementation. Not waiting on other features or changes to be implemented.Type: BugSomething isn't workingSomething isn't working
Projects
Status
Accepted