summaryrefslogtreecommitdiff
path: root/gst/gstparse.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2011-11-12 14:55:07 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2011-11-12 14:57:48 +0000
commit4d6795dcd15f957ba9faf98056d9442be3a40eee (patch)
tree22368db640422c06e6de0985783b85f4a9e58c69 /gst/gstparse.c
parent147fa8b1f7221cb3917b545143abf84cce9d7f88 (diff)
downloadgstreamer-4d6795dcd15f957ba9faf98056d9442be3a40eee.tar.gz
gst, controller: replace g_list_prepend + reverse with GQueue
Diffstat (limited to 'gst/gstparse.c')
-rw-r--r--gst/gstparse.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gst/gstparse.c b/gst/gstparse.c
index 910fc8f702..a2d3d3deaf 100644
--- a/gst/gstparse.c
+++ b/gst/gstparse.c
@@ -44,12 +44,6 @@
#include "parse/types.h"
#endif
-static void
-_prepend_missing_element (gchar * element, GList ** list)
-{
- *list = g_list_prepend (*list, g_strdup (element));
-}
-
static GstParseContext *
gst_parse_context_copy (const GstParseContext * context)
{
@@ -58,9 +52,13 @@ gst_parse_context_copy (const GstParseContext * context)
ret = gst_parse_context_new ();
if (context) {
- g_list_foreach (context->missing_elements, (GFunc) _prepend_missing_element,
- &ret->missing_elements);
- ret->missing_elements = g_list_reverse (ret->missing_elements);
+ GQueue missing_copy = G_QUEUE_INIT;
+ GList *l;
+
+ for (l = context->missing_elements; l != NULL; l = l->next)
+ g_queue_push_tail (&missing_copy, g_strdup ((const gchar *) l->data));
+
+ ret->missing_elements = missing_copy.head;
}
#endif
return ret;