From 9d9eac85ef7a44a1d76cb09f4ebcbe41ce92b8f8 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 27 Sep 2021 17:36:48 +0200 Subject: [PATCH] Store context menu items in unordered maps The difference in performance won't be noticable, but both lookups and modifications in these things are much faster once you have more than one or two elements. --- src/plugin/bridges/vst3-impls/plugin-proxy.h | 2 +- src/wine-host/bridges/vst3-impls/context-menu-proxy.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugin/bridges/vst3-impls/plugin-proxy.h b/src/plugin/bridges/vst3-impls/plugin-proxy.h index 47db1806..0f4ff02d 100644 --- a/src/plugin/bridges/vst3-impls/plugin-proxy.h +++ b/src/plugin/bridges/vst3-impls/plugin-proxy.h @@ -357,7 +357,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy { * lot of details o how this should be implemented and there's no * example implementation around. */ - std::map> targets; + std::unordered_map> targets; }; /** diff --git a/src/wine-host/bridges/vst3-impls/context-menu-proxy.h b/src/wine-host/bridges/vst3-impls/context-menu-proxy.h index e90359cc..1f36a327 100644 --- a/src/wine-host/bridges/vst3-impls/context-menu-proxy.h +++ b/src/wine-host/bridges/vst3-impls/context-menu-proxy.h @@ -55,7 +55,8 @@ class Vst3ContextMenuProxyImpl : public Vst3ContextMenuProxy { * The targets passed when to `addItem` calls made by the plugin. This way * we can call these same targets later. The key here is the item's tag. */ - std::map> + std::unordered_map> context_menu_targets; private: