From b3923b65f1f013d92d63d7906d942e1216739b90 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 30 Jul 2013 10:10:37 +0200 Subject: [PATCH] core: use variable "items_count" directly from hashtable without calling function hashtable_get_integer --- src/core/wee-command.c | 4 ++-- src/core/wee-debug.c | 8 +++----- src/core/wee-secure.c | 4 ++-- src/gui/curses/gui-curses-color.c | 3 +-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/core/wee-command.c b/src/core/wee-command.c index edcbc3818..627b9720a 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -4521,7 +4521,7 @@ COMMAND_CALLBACK(secure) _("Passphrase deleted") : _("Passphrase is not set")); if (passphrase_was_set) { - if (hashtable_get_integer (secure_hashtable_data, "items_count") > 0) + if (secure_hashtable_data->items_count > 0) command_save_file (secure_config_file); secure_buffer_display (); } @@ -4532,7 +4532,7 @@ COMMAND_CALLBACK(secure) gui_chat_printf (NULL, (passphrase_was_set) ? _("Passphrase changed") : _("Passphrase added")); - if (hashtable_get_integer (secure_hashtable_data, "items_count") > 0) + if (secure_hashtable_data->items_count > 0) command_save_file (secure_config_file); secure_buffer_display (); } diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index 6d3cb05e0..d04eef39b 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -369,10 +369,8 @@ debug_hdata_map_cb (void *data, struct t_hashtable *hashtable, gui_chat_printf (NULL, " hdata 0x%lx: \"%s\", %d vars, %d lists:", ptr_hdata, (const char *)key, - hashtable_get_integer (ptr_hdata->hash_var, - "items_count"), - hashtable_get_integer (ptr_hdata->hash_list, - "items_count")); + ptr_hdata->hash_var->items_count, + ptr_hdata->hash_list->items_count); /* display lists */ hashtable_map (ptr_hdata->hash_list, @@ -412,7 +410,7 @@ debug_hdata () { int count; - count = hashtable_get_integer (weechat_hdata, "items_count"); + count = weechat_hdata->items_count; gui_chat_printf (NULL, ""); gui_chat_printf (NULL, "%d hdata in memory", count); diff --git a/src/core/wee-secure.c b/src/core/wee-secure.c index 94d46aeb8..677439ae3 100644 --- a/src/core/wee-secure.c +++ b/src/core/wee-secure.c @@ -751,7 +751,7 @@ secure_data_write_cb (void *data, struct t_config_file *config_file, if (!config_file_write_line (config_file, section_name, NULL)) return WEECHAT_CONFIG_WRITE_ERROR; - if (hashtable_get_integer (secure_hashtable_data, "items_count") > 0) + if (secure_hashtable_data->items_count > 0) { /* * write a special line indicating if a passphrase must be used to @@ -1040,7 +1040,7 @@ secure_buffer_display () } /* display secured data */ - if (hashtable_get_integer (secure_hashtable_data, "items_count") > 0) + if (secure_hashtable_data->items_count > 0) { gui_chat_printf_y (secure_buffer, 4, _("Secured data:")); line = 6; diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index 4e7843f42..c6868834b 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -933,8 +933,7 @@ gui_color_buffer_display () } /* display palette colors */ - if (hashtable_get_integer (gui_color_hash_palette_color, - "items_count") > 0) + if (gui_color_hash_palette_color->items_count > 0) { y++; gui_chat_printf_y (gui_color_buffer, y++,