summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorAilin Nemui <ailin@esf51.localdomain>2014-06-08 02:18:57 +0200
committerAilin Nemui <ailin@esf51.localdomain>2014-06-15 23:37:13 +0200
commita4c62a3fee26761ff909e7fb01f372484db3057f (patch)
tree76fee293501c3125d094e234db69d541e63e3d01 /src/fe-common/core
parentd1e60a3b8f8a154a33e935279a6aeb356686efda (diff)
downloadirssi-a4c62a3fee26761ff909e7fb01f372484db3057f.zip
speed up window_item_find by interning name and removing call to channel_find
Diffstat (limited to 'src/fe-common/core')
-rw-r--r--src/fe-common/core/window-items.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/fe-common/core/window-items.c b/src/fe-common/core/window-items.c
index 303a80db..c29db9e6 100644
--- a/src/fe-common/core/window-items.c
+++ b/src/fe-common/core/window-items.c
@@ -218,16 +218,10 @@ WI_ITEM_REC *window_item_find_window(WINDOW_REC *window,
WI_ITEM_REC *rec = tmp->data;
if ((server == NULL || rec->server == server) &&
- g_ascii_strcasecmp(name, rec->visible_name) == 0)
+ (g_ascii_strcasecmp(name, rec->visible_name) == 0
+ || (rec->name && g_ascii_strcasecmp(name, rec->name) == 0)))
return rec;
}
-
- /* try with channel name too, it's not necessarily
- same as visible_name (!channels) */
- channel = channel_find(server, name);
- if (channel != NULL && window_item_window(channel) == window)
- return (WI_ITEM_REC *) channel;
-
return NULL;
}