Commit f014f1a1 authored by Jürg Billeter's avatar Jürg Billeter
Browse files

libtracker-db: Improve performance of D-Bus marshalling of result sets

parent c182f229
......@@ -92,41 +92,33 @@ tracker_dbus_query_result_to_ptr_array (TrackerDBResultSet *result_set)
}
while (valid) {
GSList *list = NULL;
gchar **p;
p = g_new0 (gchar *, columns + 1);
/* Append fields to the array */
for (i = 0; i < columns; i++) {
GValue transform = { 0, };
GValue value = { 0, };
gchar *str = NULL;
g_value_init (&transform, G_TYPE_STRING);
_tracker_db_result_set_get_value (result_set, i, &value);
if (G_IS_VALUE (&value) && g_value_transform (&value, &transform)) {
str = g_value_dup_string (&transform);
p[i] = g_value_dup_string (&transform);
}
if (!str) {
str = g_strdup ("");
if (!p[i]) {
p[i] = g_strdup ("");
}
list = g_slist_prepend (list, (gchar*) str);
if (G_IS_VALUE (&value)) {
g_value_unset (&value);
}
g_value_unset (&transform);
}
list = g_slist_reverse (list);
p = tracker_dbus_slist_to_strv (list);
g_slist_foreach (list, (GFunc)g_free, NULL);
g_slist_free (list);
g_ptr_array_add (ptr_array, p);
valid = tracker_db_result_set_iter_next (result_set);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment