diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2007-04-29 09:15:36 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-04-29 09:15:36 +0000 |
commit | 09f2bf2c058da1e6dd57d67d71f45f2477dc5209 (patch) | |
tree | 2fa2afa63205e8e1be4345df0993a8ac5b71cf98 /src | |
parent | aa172e0afbd634b236854b3590556b099e08cb29 (diff) | |
download | irssi-09f2bf2c058da1e6dd57d67d71f45f2477dc5209.zip |
Slightly optimize activity_hide_targets matching.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4469 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/window-activity.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/fe-common/core/window-activity.c b/src/fe-common/core/window-activity.c index eab2c02f..ae799cf5 100644 --- a/src/fe-common/core/window-activity.c +++ b/src/fe-common/core/window-activity.c @@ -69,14 +69,9 @@ void window_item_activity(WI_ITEM_REC *item, int data_level, GINT_TO_POINTER(old_data_level)); } -#define hide_target_activity(data_level, target) \ - ((target) != NULL && hide_targets != NULL && \ - strarray_find(hide_targets, target) != -1) - static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg) { WI_ITEM_REC *item; - char *tagtarget; int data_level; if (dest->window == active_win || (dest->level & hide_level)) @@ -89,19 +84,18 @@ static void sig_hilight_text(TEXT_DEST_REC *dest, const char *msg) DATA_LEVEL_MSG : DATA_LEVEL_TEXT; } - if ((dest->level & MSGLEVEL_HILIGHT) == 0 && dest->target != NULL) { + if (hide_targets != NULL && (dest->level & MSGLEVEL_HILIGHT) == 0 && dest->target != NULL) { /* check for both target and tag/target */ - if (hide_target_activity(data_level, dest->target)) + if (strarray_find(hide_targets, dest->target) != -1) return; - tagtarget = dest->server_tag == NULL ? NULL : - g_strdup_printf("%s/%s", dest->server_tag, - dest->target); - if (hide_target_activity(data_level, tagtarget)) { + if (dest->server_tag != NULL) { + char *tagtarget = g_strdup_printf("%s/%s", dest->server_tag, dest->target); + int ret = strarray_find(hide_targets, tagtarget); g_free(tagtarget); - return; + if (ret != -1) + return; } - g_free(tagtarget); } if (dest->target != NULL) { |