diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-11 12:29:17 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-04-11 12:29:27 +0200 |
| commit | 632127e9b887663c7196904299f4af6927f7d6f8 (patch) | |
| tree | 9446134e37675d96f39ca6960d5b9c4e1321b33d | |
| parent | 8ffe1eac74a76ab1de9bac6dfdd81104f19a0511 (diff) | |
use robin map in some types
| -rw-r--r-- | loader/impl.hpp | 8 | ||||
| -rw-r--r-- | serialize/world-writer.cpp | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/loader/impl.hpp b/loader/impl.hpp index 98ec8ac0..da3326b4 100644 --- a/loader/impl.hpp +++ b/loader/impl.hpp @@ -1,8 +1,8 @@ #pragma once #include "loader/loader.hpp" +#include <tsl/robin_map.h> #include <memory> #include <vector> -#include <unordered_map> #include <Corrade/Containers/Optional.h> #include <Corrade/Containers/StringView.h> #include <Corrade/Containers/StringStlHash.h> @@ -21,12 +21,12 @@ struct loader_impl final : loader_ Containers::Pointer<Trade::AbstractImporter> image_importer; Containers::Pointer<Trade::AbstractImporter> tga_importer; - std::unordered_map<StringView, std::shared_ptr<struct tile_atlas>> tile_atlas_map; - std::unordered_map<StringView, std::shared_ptr<struct anim_atlas>> anim_atlas_map; + tsl::robin_map<StringView, std::shared_ptr<struct tile_atlas>> tile_atlas_map; + tsl::robin_map<StringView, std::shared_ptr<struct anim_atlas>> anim_atlas_map; std::vector<String> anim_atlases; std::vector<serialized_scenery> sceneries_array; - std::unordered_map<StringView, const serialized_scenery*> sceneries_map; + tsl::robin_map<StringView, const serialized_scenery*> sceneries_map; String original_working_directory; diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp index d0a960ef..ddc9dffa 100644 --- a/serialize/world-writer.cpp +++ b/serialize/world-writer.cpp @@ -16,6 +16,7 @@ #include <cstring> #include <vector> #include <algorithm> +#include <tsl/robin_map.h> #include <Corrade/Containers/StringStlHash.h> #include <Corrade/Utility/Path.h> @@ -67,9 +68,9 @@ private: const world* _world; std::vector<char> atlas_buf, scenery_buf, chunk_buf, file_buf, string_buf; std::vector<std::vector<char>> chunk_bufs; - std::unordered_map<const void*, interned_atlas> tile_images; + tsl::robin_map<const void*, interned_atlas> tile_images; std::unordered_map<const void*, std::vector<interned_scenery>> scenery_map; - std::unordered_map<StringView, uint32_t> string_map; + tsl::robin_map<StringView, uint32_t> string_map; atlasid scenery_map_size = 0; }; |
