opencv: motioncells: remove unnecessary check
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Tue, 20 Oct 2015 11:08:59 +0000 (12:08 +0100)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Tue, 20 Oct 2015 11:09:01 +0000 (12:09 +0100)
We know that the gchar arrays contain at least one string. Furthermore,
g_strfreev() checks if the array is NULL and simply returns if it is.
Hence, there is no need to check if the array is empty before using
g_strfreev().

CID 1327412-1327415

ext/opencv/gstmotioncells.cpp

index c2dcab9..1fde6ec 100644 (file)
@@ -517,8 +517,7 @@ gst_motion_cells_set_property (GObject * object, guint prop_id,
           filter->motionmaskcoord_count = 0;
         }
       }
-      if (strs)
-        g_strfreev (strs);
+      g_strfreev (strs);
       tmpux = -1;
       tmpuy = -1;
       tmplx = -1;
@@ -545,8 +544,7 @@ gst_motion_cells_set_property (GObject * object, guint prop_id,
           filter->motionmaskcells_count = 0;
         }
       }
-      if (motionmaskcellsstr)
-        g_strfreev (motionmaskcellsstr);
+      g_strfreev (motionmaskcellsstr);
       tmpux = -1;
       tmpuy = -1;
       tmplx = -1;
@@ -568,8 +566,7 @@ gst_motion_cells_set_property (GObject * object, guint prop_id,
         filter->motioncellscolor->G_channel_value = g;
         filter->motioncellscolor->B_channel_value = b;
       }
-      if (colorstr)
-        g_strfreev (colorstr);
+      g_strfreev (colorstr);
       break;
     case PROP_MOTIONCELLSIDX:
       motioncellsstr = g_strsplit (g_value_get_string (value), ",", 255);
@@ -595,8 +592,7 @@ gst_motion_cells_set_property (GObject * object, guint prop_id,
           filter->motioncells_count = 0;
         }
       }
-      if (motioncellsstr)
-        g_strfreev (motioncellsstr);
+      g_strfreev (motioncellsstr);
       tmpux = -1;
       tmpuy = -1;
       tmplx = -1;