summaryrefslogtreecommitdiff
path: root/gdata/media
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2009-07-03 10:12:09 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2009-07-03 10:12:09 +0100
commit97355e5cfc3bb12afb30b690aa0e4b185457b931 (patch)
treef8057de830948117508d568a3a02305de622ee4a /gdata/media
parent65531a6bae54340722c2cdaa5e156a9ca9a49637 (diff)
downloadlibgdata-97355e5cfc3bb12afb30b690aa0e4b185457b931.tar.gz
[core] Made the get_xml functions use a single GString throughout
Previously, each call to _gdata_parsable_get_xml would create its own GString, then destroy it at the end. Now, the same GString is reused throughout a tree of calls to _gdata_parsable_get_xml, saving quite a few allocations/frees (in exchange for more reallocations).
Diffstat (limited to 'gdata/media')
-rw-r--r--gdata/media/gdata-media-group.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdata/media/gdata-media-group.c b/gdata/media/gdata-media-group.c
index 778980b0..f4004d34 100644
--- a/gdata/media/gdata-media-group.c
+++ b/gdata/media/gdata-media-group.c
@@ -263,11 +263,8 @@ get_xml (GDataParsable *parsable, GString *xml_string)
GDataMediaGroupPrivate *priv = GDATA_MEDIA_GROUP (parsable)->priv;
/* Media category */
- if (priv->category != NULL) {
- gchar *xml = _gdata_parsable_get_xml (GDATA_PARSABLE (priv->category), FALSE);
- g_string_append (xml_string, xml);
- g_free (xml);
- }
+ if (priv->category != NULL)
+ _gdata_parsable_get_xml (GDATA_PARSABLE (priv->category), xml_string, FALSE);
if (priv->title != NULL) {
gchar *title = g_markup_escape_text (priv->title, -1);