commit c1de322b02be4612a6640b5e838fba03579432c2
parent 8cbdeff928a708523ab6191b6b8074d66b680808
Author: fundamental <[email protected]>
Date: Sat, 10 Oct 2015 23:55:35 -0400
UI: Reduce Redundant update() Calls on Path Damage
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/UI/Connection.cpp b/src/UI/Connection.cpp
@@ -345,14 +345,18 @@ class UI_Interface:public Fl_Osc_Interface
{
#ifndef NO_UI
printf("\n\nDamage(\"%s\")\n", path);
+ std::set<Fl_Osc_Widget*> to_update;
for(auto pair:map) {
if(strstr(pair.first.c_str(), path)) {
auto *tmp = dynamic_cast<Fl_Widget*>(pair.second);
if(!tmp || tmp->visible_r()) {
- pair.second->update();
+ to_update.insert(pair.second);
}
}
}
+
+ for(auto elm:to_update)
+ elm->update();
#endif
}