summaryrefslogtreecommitdiff
path: root/src/protocol.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-07-13 18:22:07 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-07-15 16:21:03 +0100
commit7240d889f75b7a4faa7b27eb07628f71a5534938 (patch)
tree57fcfd3abd71674934bda9a3482e874135f2dc31 /src/protocol.c
parent209f73255c2e63e0e9708a306dda537374a9ccf6 (diff)
downloadtelepathy-haze-7240d889f75b7a4faa7b27eb07628f71a5534938.tar.gz
haze_protocol_build_protocol_table: cache the result
Diffstat (limited to 'src/protocol.c')
-rw-r--r--src/protocol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/protocol.c b/src/protocol.c
index e044e11..def7be8 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -106,10 +106,13 @@ _compare_protocol_id (gpointer key,
GHashTable *
haze_protocol_build_protocol_table (void)
{
- GHashTable *table;
+ static GHashTable *table = NULL;
HazeProtocolInfo *i;
GList *iter;
+ if (table != NULL)
+ return table;
+
table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
for (i = known_protocol_info; i->prpl_id != NULL; i++)