From 9c635f28ac2b103bf7196e47947bf64673c13393 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 5 Aug 2015 22:29:47 +0200 Subject: Little optimization on getAdded/Removed activeobjects per player loop. Use std::queue instead of std::set, we don't need such a heavy container. Don't convert position to int to convert it back to float in the next function. --- src/environment.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/environment.h') diff --git a/src/environment.h b/src/environment.h index 22840a9fc..41295abf2 100644 --- a/src/environment.h +++ b/src/environment.h @@ -265,19 +265,19 @@ public: Find out what new objects have been added to inside a radius around a position */ - void getAddedActiveObjects(v3s16 pos, s16 radius, + void getAddedActiveObjects(Player *player, s16 radius, s16 player_radius, std::set ¤t_objects, - std::set &added_objects); + std::queue &added_objects); /* Find out what new objects have been removed from inside a radius around a position */ - void getRemovedActiveObjects(v3s16 pos, s16 radius, + void getRemovedActiveObjects(Player* player, s16 radius, s16 player_radius, std::set ¤t_objects, - std::set &removed_objects); + std::queue &removed_objects); /* Get the next message emitted by some active object. -- cgit v1.2.3