From 2079462e62b478555b1b614a90692b6bc9bb5d34 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Tue, 17 Feb 2015 16:49:27 +0100 Subject: Change many useless std::list into Environment class (m_players), ABMHandler and ActiveBlockList::update This improve looping performances. --- 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 13c0c0efe..9eb440c42 100644 --- a/src/environment.h +++ b/src/environment.h @@ -75,8 +75,8 @@ public: Player * getPlayer(const char *name); Player * getRandomConnectedPlayer(); Player * getNearestConnectedPlayer(v3f pos); - std::list getPlayers(); - std::list getPlayers(bool ignore_disconnected); + std::vector getPlayers(); + std::vector getPlayers(bool ignore_disconnected); u32 getDayNightRatio(); @@ -110,7 +110,7 @@ public: protected: // peer_ids in here should be unique, except that there may be many 0s - std::list m_players; + std::vector m_players; // Time of day in milli-hours (0-23999); determines day and night u32 m_time_of_day; // Time of day in 0...1 @@ -182,7 +182,7 @@ struct ABMWithState class ActiveBlockList { public: - void update(std::list &active_positions, + void update(std::vector &active_positions, s16 radius, std::set &blocks_removed, std::set &blocks_added); -- cgit v1.2.3