summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-05-26 18:40:47 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-05-26 18:40:47 +0200
commit1b58fb30a3205e68f03f021e8c4314cf59629683 (patch)
treea35f9765d36c5eccd71de22b3461ca51583e4de6 /include
parent65bffccfd91820cbf0518c841a33995999c68a57 (diff)
downloadqtlocation-mapboxgl-1b58fb30a3205e68f03f021e8c4314cf59629683.tar.gz
use unordered map, don't make copies (auto usage!) and swap maps
Diffstat (limited to 'include')
-rw-r--r--include/llmr/style/style.hpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/include/llmr/style/style.hpp b/include/llmr/style/style.hpp
index 4aa4b748b3..048c4d545a 100644
--- a/include/llmr/style/style.hpp
+++ b/include/llmr/style/style.hpp
@@ -12,6 +12,7 @@
#include <llmr/util/uv.hpp>
#include <map>
+#include <unordered_map>
#include <vector>
#include <set>
#include <memory>
@@ -52,12 +53,12 @@ public:
std::set<std::string> appliedClasses;
struct {
BackgroundProperties background;
- std::map<std::string, FillProperties> fills;
- std::map<std::string, LineProperties> lines;
- std::map<std::string, IconProperties> icons;
- std::map<std::string, TextProperties> texts;
- std::map<std::string, RasterProperties> rasters;
- std::map<std::string, CompositeProperties> composites;
+ std::unordered_map<std::string, FillProperties> fills;
+ std::unordered_map<std::string, LineProperties> lines;
+ std::unordered_map<std::string, IconProperties> icons;
+ std::unordered_map<std::string, TextProperties> texts;
+ std::unordered_map<std::string, RasterProperties> rasters;
+ std::unordered_map<std::string, CompositeProperties> composites;
std::map<std::string, std::map<TransitionablePropertyKey, std::string>> effective_classes;
} computed;
@@ -74,24 +75,24 @@ private:
// Last applied settings.
struct {
BackgroundProperties background;
- std::map<std::string, FillProperties> fills;
- std::map<std::string, LineProperties> lines;
- std::map<std::string, IconProperties> icons;
- std::map<std::string, TextProperties> texts;
- std::map<std::string, RasterProperties> rasters;
- std::map<std::string, CompositeProperties> composites;
+ std::unordered_map<std::string, FillProperties> fills;
+ std::unordered_map<std::string, LineProperties> lines;
+ std::unordered_map<std::string, IconProperties> icons;
+ std::unordered_map<std::string, TextProperties> texts;
+ std::unordered_map<std::string, RasterProperties> rasters;
+ std::unordered_map<std::string, CompositeProperties> composites;
std::map<std::string, std::map<TransitionablePropertyKey, std::string>> effective_classes;
} previous;
// Settings values currently being transitioned.
struct {
BackgroundProperties background;
- std::map<std::string, FillProperties> fills;
- std::map<std::string, LineProperties> lines;
- std::map<std::string, IconProperties> icons;
- std::map<std::string, TextProperties> texts;
- std::map<std::string, RasterProperties> rasters;
- std::map<std::string, CompositeProperties> composites;
+ std::unordered_map<std::string, FillProperties> fills;
+ std::unordered_map<std::string, LineProperties> lines;
+ std::unordered_map<std::string, IconProperties> icons;
+ std::unordered_map<std::string, TextProperties> texts;
+ std::unordered_map<std::string, RasterProperties> rasters;
+ std::unordered_map<std::string, CompositeProperties> composites;
} transitioning;
std::map<std::string, std::map<TransitionablePropertyKey, PropertyTransition>> properties_to_transition;