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.
This commit is contained in:
Robbert van der Helm
2021-09-27 17:36:48 +02:00
parent 4bf7e8a5a2
commit 9d9eac85ef
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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<int32, Steinberg::IPtr<YaContextMenuTarget>> targets;
std::unordered_map<int32, Steinberg::IPtr<YaContextMenuTarget>> targets;
};
/**
@@ -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<int32, Steinberg::IPtr<Steinberg::Vst::IContextMenuTarget>>
std::unordered_map<int32,
Steinberg::IPtr<Steinberg::Vst::IContextMenuTarget>>
context_menu_targets;
private: