quick checks on empty control lists, to avoid unnecessary work
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 6 Jul 2016 19:20:17 +0000 (15:20 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 6 Jul 2016 19:20:17 +0000 (15:20 -0400)
libs/ardour/session_rtevents.cc

index 8dba60f0e5cbe0017d423d80c2bad63d96a29b09..f1f99e369373e3dda0e9380482cae287f6001d55 100644 (file)
@@ -37,6 +37,10 @@ using namespace Glib;
 void
 Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
 {
+       if (cl->empty()) {
+               return;
+       }
+
        std::cerr << "Session::set_controls called on " << cl->size() << " controls, group = " << enum_2_string (gcd) << std::endl;
 
        for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
@@ -50,6 +54,10 @@ Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllab
 void
 Session::set_control (boost::shared_ptr<AutomationControl> ac, double val, Controllable::GroupControlDisposition gcd)
 {
+       if (!ac) {
+               return;
+       }
+
        boost::shared_ptr<ControlList> cl (new ControlList);
        cl->push_back (ac);
        set_controls (cl, val, gcd);