1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +02:00

Improved main loop (less CPU usage), better precision for timers, use of one list by hook type (for fast search in hooks)

This commit is contained in:
Sebastien Helleu
2007-12-14 17:01:02 +01:00
parent 70e44d3c54
commit e62ec5204c
19 changed files with 730 additions and 387 deletions
+12 -4
View File
@@ -1255,9 +1255,15 @@ plugin_api_infobar_printf (struct t_weechat_plugin *plugin, int time_displayed,
va_end (argptr);
buf2 = string_iconv_to_internal (plugin->charset, buf);
num_color = gui_color_search_config (color_name);
if (num_color < 0)
if (color_name && color_name[0])
{
num_color = gui_color_search_config (color_name);
if (num_color < 0)
num_color = GUI_COLOR_INFOBAR;
}
else
num_color = GUI_COLOR_INFOBAR;
gui_infobar_printf (time_displayed,
num_color,
"%s",
@@ -1314,10 +1320,12 @@ plugin_api_hook_command (struct t_weechat_plugin *plugin, char *command,
struct t_hook *
plugin_api_hook_timer (struct t_weechat_plugin *plugin, long interval,
int max_calls, int (*callback)(void *), void *data)
int align_second, int max_calls,
int (*callback)(void *), void *data)
{
if (plugin && (interval > 0) && callback)
return hook_timer (plugin, interval, max_calls, callback, data);
return hook_timer (plugin, interval, align_second, max_calls,
callback, data);
return NULL;
}