GenericUI: replace if() by assert()
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Thu, 28 Jul 2016 21:50:33 +0000 (23:50 +0200)
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Thu, 28 Jul 2016 22:07:02 +0000 (00:07 +0200)
It makes no sense to check for the validity of mcontrol only for
controller creation, since the remainder of the code assumes that the
controller will have been created correctly.

Replace that by an assert.

gtk2_ardour/generic_pluginui.cc

index ddaba074ce21e7dda13e153d380e9d078e1ef3de..1f7b94129ed0e682446b367d0f22daaa9496d83f 100644 (file)
@@ -696,6 +696,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
                        return control_ui;
                }
 
+               assert(mcontrol);
 
                /* See if there any named values for our input value */
                control_ui->scale_points = desc.scale_points;
@@ -744,9 +745,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
                         * destructor, and manage() reports object hierarchy
                         * ambiguity.
                         */
-                       if (mcontrol) {
-                               control_ui->controller = AutomationController::create(insert, mcontrol->parameter(), desc, mcontrol, use_knob);
-                       }
+                       control_ui->controller = AutomationController::create(insert, mcontrol->parameter(), desc, mcontrol, use_knob);
 
                        /* XXX this code is not right yet, because it doesn't handle
                           the absence of bounds in any sensible fashion.