diff options
author | Robin Gareus <robin@gareus.org> | 2014-06-28 21:45:52 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-06-28 22:02:20 +0200 |
commit | fd7cddb847639b28bbeaf72d5b613833761efe6f (patch) | |
tree | fc47fa06466cdfd1fc703762b3af17583ef3dd0a /gtk2_ardour/axis_view.cc | |
parent | 4a7eb62bf869e156d58e5c6f56ac355e747b3ad9 (diff) |
use a hash-table to cache gui properties
Diffstat (limited to 'gtk2_ardour/axis_view.cc')
-rw-r--r-- | gtk2_ardour/axis_view.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk2_ardour/axis_view.cc b/gtk2_ardour/axis_view.cc index 41efbf86ae..5e36fc43c1 100644 --- a/gtk2_ardour/axis_view.cc +++ b/gtk2_ardour/axis_view.cc @@ -66,7 +66,14 @@ AxisView::unique_random_color() string AxisView::gui_property (const string& property_name) const { - return gui_object_state().get_string (state_id(), property_name); + if (property_hashtable.count(property_name)) { + return property_hashtable[property_name]; + } else { + string rv = gui_object_state().get_string (state_id(), property_name); + property_hashtable.erase(property_name); + property_hashtable.emplace(property_name, rv); + return rv; + } } bool @@ -84,7 +91,6 @@ AxisView::set_marked_for_display (bool yn) set_gui_property ("visible", yn); return true; // things changed } - return false; } |