summaryrefslogtreecommitdiff
path: root/src/plugins/relay
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-01-26 19:26:43 +0100
committerSebastien Helleu <flashcode@flashtux.org>2013-01-26 19:26:43 +0100
commit25eaec3864a7ffe48b042057f8c07da26b676337 (patch)
tree05da43a9e66a6b1b4db6551689a61d8acc8cd21c /src/plugins/relay
parentf4dce0472391432e8af4f2c0e39401d90cb86737 (diff)
downloadweechat-25eaec3864a7ffe48b042057f8c07da26b676337.zip
core: use size of 32 for hashtables (instead of 4, 8 or 16)
A size of 32 will use a little more memory but will reduce collisions in key hashs, and then length of linked lists inside hash structure (faster search in hashtable).
Diffstat (limited to 'src/plugins/relay')
-rw-r--r--src/plugins/relay/irc/relay-irc.c6
-rw-r--r--src/plugins/relay/relay-config.c2
-rw-r--r--src/plugins/relay/weechat/relay-weechat.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c
index 5534a6e5e..2f7b13ac7 100644
--- a/src/plugins/relay/irc/relay-irc.c
+++ b/src/plugins/relay/irc/relay-irc.c
@@ -155,7 +155,7 @@ relay_irc_message_parse (const char *message)
hash_msg = NULL;
hash_parsed = NULL;
- hash_msg = weechat_hashtable_new (8,
+ hash_msg = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -211,7 +211,7 @@ relay_irc_sendf (struct t_relay_client *client, const char *format, ...)
if (pos)
pos[0] = '\0';
- hashtable_in = weechat_hashtable_new (8,
+ hashtable_in = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -1574,7 +1574,7 @@ relay_irc_recv_one_msg (struct t_relay_client *client, char *data)
}
else if (!relay_irc_command_ignored (irc_command))
{
- hash_redirect = weechat_hashtable_new (8,
+ hash_redirect = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c
index 979cb20c4..d38c22f5e 100644
--- a/src/plugins/relay/relay-config.c
+++ b/src/plugins/relay/relay-config.c
@@ -204,7 +204,7 @@ relay_config_change_irc_backlog_tags (void *data,
if (!relay_config_hashtable_irc_backlog_tags)
{
- relay_config_hashtable_irc_backlog_tags = weechat_hashtable_new (8,
+ relay_config_hashtable_irc_backlog_tags = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
diff --git a/src/plugins/relay/weechat/relay-weechat.c b/src/plugins/relay/weechat/relay-weechat.c
index 2fc08f6e7..be729f524 100644
--- a/src/plugins/relay/weechat/relay-weechat.c
+++ b/src/plugins/relay/weechat/relay-weechat.c
@@ -204,7 +204,7 @@ relay_weechat_alloc (struct t_relay_client *client)
RELAY_WEECHAT_DATA(client, password_ok) = (password && password[0]) ? 0 : 1;
RELAY_WEECHAT_DATA(client, compression) = 1;
RELAY_WEECHAT_DATA(client, buffers_sync) =
- weechat_hashtable_new (16,
+ weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_INTEGER,
NULL,
@@ -213,7 +213,7 @@ relay_weechat_alloc (struct t_relay_client *client)
RELAY_WEECHAT_DATA(client, hook_signal_nicklist) = NULL;
RELAY_WEECHAT_DATA(client, hook_signal_upgrade) = NULL;
RELAY_WEECHAT_DATA(client, buffers_nicklist) =
- weechat_hashtable_new (16,
+ weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
@@ -245,7 +245,7 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
RELAY_WEECHAT_DATA(client, compression) = weechat_infolist_integer (infolist, "compression");
/* sync of buffers */
- RELAY_WEECHAT_DATA(client, buffers_sync) = weechat_hashtable_new (16,
+ RELAY_WEECHAT_DATA(client, buffers_sync) = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_INTEGER,
NULL,
@@ -268,7 +268,7 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
RELAY_WEECHAT_DATA(client, hook_signal_nicklist) = NULL;
RELAY_WEECHAT_DATA(client, hook_signal_upgrade) = NULL;
RELAY_WEECHAT_DATA(client, buffers_nicklist) =
- weechat_hashtable_new (16,
+ weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,