diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-17 16:49:27 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-17 16:50:03 +0100 |
commit | 2079462e62b478555b1b614a90692b6bc9bb5d34 (patch) | |
tree | 13ce2475f571c6d139408d5f10b4da1fb892e994 /src/environment.h | |
parent | 81b9c023c4f96d2db06706496e0578fdd1b6377b (diff) | |
download | hax-minetest-server-2079462e62b478555b1b614a90692b6bc9bb5d34.tar.gz hax-minetest-server-2079462e62b478555b1b614a90692b6bc9bb5d34.zip |
Change many useless std::list into Environment class (m_players), ABMHandler and ActiveBlockList::update
This improve looping performances.
Diffstat (limited to 'src/environment.h')
-rw-r--r-- | src/environment.h | 8 |
1 files changed, 4 insertions, 4 deletions
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<Player*> getPlayers(); - std::list<Player*> getPlayers(bool ignore_disconnected); + std::vector<Player*> getPlayers(); + std::vector<Player*> 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<Player*> m_players; + std::vector<Player*> 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<v3s16> &active_positions, + void update(std::vector<v3s16> &active_positions, s16 radius, std::set<v3s16> &blocks_removed, std::set<v3s16> &blocks_added); |