-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Why does road during decay iterates 2 times through all room objects searching for objects of type "swamp" and "wall". Shouldn't it be enough to just check the terrain mask?
| if(_.any(roomObjects, (i) => i.x == object.x && i.y == object.y && i.type == 'swamp') || |
| if(_.any(roomObjects, (i) => i.x == object.x && i.y == object.y && i.type == 'wall') || |
Removing the _.any(...) check would change complexity from O(n) to O(1).
I don't have any server to check impacts of this optimizations.
Metadata
Metadata
Assignees
Labels
No labels