Skip to content

Unintended multiple evaluations throughout Lusk #71

@sovdeeth

Description

@sovdeeth

Describe the bug
A list of code locations where expressions get evaluated more than once.

Expected behavior
Expressions should only ever be evaluated once per get()/execute() call (excepting intentional circumstances like mapping expressions or similar)

Locations

AnvilGuiWrapper anvilGuiWrapper = anvilGuiWrapperExpression.getSingle(event);

entityExpression != null ? entityExpression.getSingle(event) : null,

(not a big deal because literals only, but a bit wasteful)
return test(boundingBox1, event, box1 -> test(boundingBox2, event, box1::overlaps), isNegated());


return worldExpression.stream(event).flatMap(world -> boundingBoxExpression.stream(event).flatMap(boundingBox ->

return worldExpression.stream(event).flatMap(world -> world.getNearbyEntities(boundingBox, filter).stream());
(tracked in #63)





return test(offlinePlayerExpression, event, offlinePlayer -> {



Metadata

Metadata

Assignees

Labels

Area: Lusk (Skript)Takes place in the 'skript' module. More specifically in the skript implementation.Priority: MediumShould be addressed decently soon,Status: PlannedPlanned for implementation. Not waiting on other features or changes to be implemented.Type: PatchAn issue is present and needs to be addressed.

Projects

Status

Under Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions