diff options
author | sfan5 <sfan5@live.de> | 2022-07-31 23:16:40 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-08-02 11:58:26 +0200 |
commit | f22d40975e907d9f0e84b67b21256953333a6cc8 (patch) | |
tree | 20001947bf5e64db5a71c426ebb6a413d5e0c1dc /src/client/mesh_generator_thread.h | |
parent | 4c1ef1b72bfb949b149e6eb75cb7082e31d22b5d (diff) | |
download | minetest-f22d40975e907d9f0e84b67b21256953333a6cc8.tar.xz |
Switch MeshUpdateQueue to better data structure
Diffstat (limited to 'src/client/mesh_generator_thread.h')
-rw-r--r-- | src/client/mesh_generator_thread.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/mesh_generator_thread.h b/src/client/mesh_generator_thread.h index e48c8334d..552b2a9f0 100644 --- a/src/client/mesh_generator_thread.h +++ b/src/client/mesh_generator_thread.h @@ -21,6 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <ctime> #include <mutex> +#include <unordered_map> +#include <unordered_set> #include "mapblock_mesh.h" #include "threading/mutex_auto_lock.h" #include "util/thread.h" @@ -81,8 +83,8 @@ public: private: Client *m_client; std::vector<QueuedMeshUpdate *> m_queue; - std::set<v3s16> m_urgents; - std::map<v3s16, CachedMapBlockData *> m_cache; + std::unordered_set<v3s16> m_urgents; + std::unordered_map<v3s16, CachedMapBlockData *> m_cache; u64 m_next_cache_cleanup; // milliseconds std::mutex m_mutex; |