structure: use local variable earlier
authorStefan Kost <ensonic@users.sf.net>
Mon, 16 Nov 2009 11:53:44 +0000 (13:53 +0200)
committerStefan Kost <ensonic@users.sf.net>
Tue, 17 Nov 2009 07:40:12 +0000 (09:40 +0200)
gst/gststructure.c

index 051c541..fb48c81 100644 (file)
@@ -296,11 +296,9 @@ gst_structure_copy (const GstStructure * structure)
 
   g_return_val_if_fail (structure != NULL, NULL);
 
-  new_structure =
-      gst_structure_id_empty_new_with_size (structure->name,
-      structure->fields->len);
-
   len = structure->fields->len;
+  new_structure = gst_structure_id_empty_new_with_size (structure->name, len);
+
   for (i = 0; i < len; i++) {
     GstStructureField new_field = { 0 };