[tracker/dbus-performance] libtracker-db: Improve performance of D-Bus marshalling of result sets
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/dbus-performance] libtracker-db: Improve performance of D-Bus marshalling of result sets
- Date: Thu, 8 Apr 2010 14:05:31 +0000 (UTC)
commit f014f1a1d51850c0e48905952c2ed30fba399f93
Author: Jürg Billeter <j bitron ch>
Date: Thu Apr 8 16:04:50 2010 +0200
libtracker-db: Improve performance of D-Bus marshalling of result sets
src/libtracker-db/tracker-db-dbus.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-dbus.c b/src/libtracker-db/tracker-db-dbus.c
index 99db3dd..05b70bf 100644
--- a/src/libtracker-db/tracker-db-dbus.c
+++ b/src/libtracker-db/tracker-db-dbus.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]