audiodynamic: remove always-true conditional
authorLuis de Bethencourt <luis.bg@samsung.com>
Wed, 7 Jan 2015 17:31:39 +0000 (17:31 +0000)
committerLuis de Bethencourt <luis.bg@samsung.com>
Wed, 7 Jan 2015 17:31:39 +0000 (17:31 +0000)
func_index is set by the sum of three ternary operators which add, 0:4, 0:2,
and 1:0. Minimum value would be 0+0+0=0, and maximum would be 4+2+1=7.
The conditional checking if func_index is >= 0 and < 8 will always be true.
Removing it.

CID 1226442

gst/audiofx/audiodynamic.c

index 62deed7..c1e7068 100644 (file)
@@ -193,12 +193,8 @@ gst_audio_dynamic_set_process_function (GstAudioDynamic * filter,
   func_index += (filter->characteristics == CHARACTERISTICS_HARD_KNEE) ? 0 : 2;
   func_index += (GST_AUDIO_INFO_FORMAT (info) == GST_AUDIO_FORMAT_F32) ? 1 : 0;
 
-  if (func_index >= 0 && func_index < 8) {
-    filter->process = process_functions[func_index];
-    return TRUE;
-  }
-
-  return FALSE;
+  filter->process = process_functions[func_index];
+  return TRUE;
 }
 
 /* GObject vmethod implementations */