From db3223478c914f5b9ef97343ae2f262d3e99f74b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 6 Jul 2016 15:20:17 -0400 Subject: [PATCH] quick checks on empty control lists, to avoid unnecessary work --- libs/ardour/session_rtevents.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc index 8dba60f0e5..f1f99e3693 100644 --- a/libs/ardour/session_rtevents.cc +++ b/libs/ardour/session_rtevents.cc @@ -37,6 +37,10 @@ using namespace Glib; void Session::set_controls (boost::shared_ptr 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 cl, double val, Controllab void Session::set_control (boost::shared_ptr ac, double val, Controllable::GroupControlDisposition gcd) { + if (!ac) { + return; + } + boost::shared_ptr cl (new ControlList); cl->push_back (ac); set_controls (cl, val, gcd); -- 2.30.2