From 708fb012762d38d2a50722a1ea50da2a7eb98d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 27 May 2014 11:55:40 +0200 Subject: [PATCH] used unordered_maps --- include/llmr/style/properties.hpp | 14 ++++++++++++++ include/llmr/style/style.hpp | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/include/llmr/style/properties.hpp b/include/llmr/style/properties.hpp index af304c1ea..4dfc7e40b 100644 --- a/include/llmr/style/properties.hpp +++ b/include/llmr/style/properties.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -221,4 +222,17 @@ const CompositeProperties defaultCompositeProperties; } + +namespace std { + +template <> struct hash { +public: + inline size_t operator()(llmr::TransitionablePropertyKey prop) const { + typedef typename std::underlying_type::type type; + return std::hash()(static_cast(prop)); + } +}; + +} + #endif diff --git a/include/llmr/style/style.hpp b/include/llmr/style/style.hpp index 048c4d545..425059758 100644 --- a/include/llmr/style/style.hpp +++ b/include/llmr/style/style.hpp @@ -59,7 +59,7 @@ public: std::unordered_map texts; std::unordered_map rasters; std::unordered_map composites; - std::map> effective_classes; + std::unordered_map> effective_classes; } computed; private: @@ -81,7 +81,7 @@ private: std::unordered_map texts; std::unordered_map rasters; std::unordered_map composites; - std::map> effective_classes; + std::unordered_map> effective_classes; } previous; // Settings values currently being transitioned. @@ -95,8 +95,8 @@ private: std::unordered_map composites; } transitioning; - std::map> properties_to_transition; - std::map>> transitions; + std::unordered_map> properties_to_transition; + std::unordered_map>> transitions; uint64_t default_transition_duration = 0; bool initial_render_complete = false;