summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-03-22 17:53:23 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-03-22 17:53:23 +0000
commitcc8c9ab2fdce8365be2f788820da2847a1fbd188 (patch)
treeacb150795663858fdfb8a2d1ef1dc9e22e6879ab /src
parent1c31ca61bdd3a50dfdf9a7958b0e7ff57fb56bdd (diff)
Allocate arrays of changed properties with allocated size = number of props
Diffstat (limited to 'src')
-rw-r--r--src/gabble-muc-channel.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gabble-muc-channel.c b/src/gabble-muc-channel.c
index e80e1b22..0943a581 100644
--- a/src/gabble-muc-channel.c
+++ b/src/gabble-muc-channel.c
@@ -346,9 +346,10 @@ properties_disco_cb (GabbleDisco *disco,
NODE_DEBUG (query_result, "disco query result");
- /* FIXME: preallocate some space? */
- changed_props_val = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
- changed_props_flags = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
+ changed_props_val = g_array_sized_new (FALSE, FALSE, sizeof (guint),
+ NUM_ROOM_PROPS);
+ changed_props_flags = g_array_sized_new (FALSE, FALSE, sizeof (guint),
+ NUM_ROOM_PROPS);
/*
* Update room definition.
@@ -1408,9 +1409,10 @@ update_permissions (GabbleMucChannel *chan)
* and own role and affiliation.
*/
- /* FIXME: preallocate some space? */
- changed_props_val = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
- changed_props_flags = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
+ changed_props_val = g_array_sized_new (FALSE, FALSE, sizeof (guint),
+ NUM_ROOM_PROPS);
+ changed_props_flags = g_array_sized_new (FALSE, FALSE, sizeof (guint),
+ NUM_ROOM_PROPS);
/*
* Subject
@@ -1802,9 +1804,10 @@ _gabble_muc_channel_receive (GabbleMucChannel *chan,
return TRUE;
}
- /* FIXME: preallocate some space? */
- changed_values = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
- changed_flags = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
+ changed_values = g_array_sized_new (FALSE, FALSE, sizeof (guint),
+ NUM_ROOM_PROPS);
+ changed_flags = g_array_sized_new (FALSE, FALSE, sizeof (guint),
+ NUM_ROOM_PROPS);
/* ROOM_PROP_SUBJECT */
g_value_init (&val, G_TYPE_STRING);