summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-node.h
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-03-17 08:54:02 +0000
committerRichard Hughes <richard@hughsie.com>2014-03-17 09:12:15 +0000
commit342fa73e00223f5b4a35b22f3517ef75f112f60a (patch)
treeee2b2225abd7da365169c7f88af63f86a3cfcae3 /libappstream-glib/as-node.h
parent542799577f041a850f88eafeccdd1ae18b7fc984 (diff)
downloadappstream-glib-342fa73e00223f5b4a35b22f3517ef75f112f60a.tar.gz
Reduce the amount of string copying when parsing a GNode tree
By introducing as_node_take_data() we can take ownership of the string data, and avoid an extra g_strdup/g_free for each tag processed. This speeds up reading the sample data by ~5%.
Diffstat (limited to 'libappstream-glib/as-node.h')
-rw-r--r--libappstream-glib/as-node.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libappstream-glib/as-node.h b/libappstream-glib/as-node.h
index ed2d944..1e4b72d 100644
--- a/libappstream-glib/as-node.h
+++ b/libappstream-glib/as-node.h
@@ -59,6 +59,7 @@ void as_node_unref (GNode *node);
const gchar *as_node_get_name (const GNode *node);
const gchar *as_node_get_data (const GNode *node);
+gchar *as_node_take_data (const GNode *node);
const gchar *as_node_get_attribute (const GNode *node,
const gchar *key);
gint as_node_get_attribute_as_int (const GNode *node,