From 0b465f48da16c2e4f634a53892705c7ecc885ece Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 23 Jun 2017 15:37:34 +0200 Subject: [PATCH] use unordered_map for id->obj maps Signed-off-by: Marcus Fritzsch --- src/main.cpp | 1 - src/wayland.cpp | 5 ++--- src/wayland.hpp | 10 +++++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 91b0c50..cc94190 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/src/wayland.cpp b/src/wayland.cpp index b644313..c660bec 100644 --- a/src/wayland.cpp +++ b/src/wayland.cpp @@ -74,9 +74,8 @@ void registry::global(uint32_t name, char const *iface, uint32_t v) { auto b = this->bindings.find(iface); if (b != this->bindings.end()) b->second(this->proxy, name, v); - else - logdebug("wl::registry @ %p global n %u i %s v %u", this->proxy, name, - iface, v); + logdebug("wl::registry @ %p global n %u i %s v %u", this->proxy, name, + iface, v); } void registry::global_remove(uint32_t name) {} diff --git a/src/wayland.hpp b/src/wayland.hpp index da3cc29..df9b68e 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -6,7 +6,7 @@ #include "util.h" #include -#include +#include #include #include @@ -69,7 +69,7 @@ struct display { // |___/ |___/ struct registry : public wayland_proxy { typedef std::function binder; - std::map bindings; + std::unordered_map bindings; registry(struct wl_display *d); ~registry(); @@ -298,9 +298,9 @@ struct screen : public wayland_proxy, // \___\___/|_| |_|\__|_| \___/|_|_|\___|_| // struct controller : public wayland_proxy { - std::map> surfaces; - std::map> layers; - std::map> screens; + std::unordered_map> surfaces; + std::unordered_map> layers; + std::unordered_map> screens; typedef std::pair> name_task_pair; -- 2.16.6