summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@0x90.dk>2014-06-16 00:27:07 +0200
committerAlexander Færøy <ahf@0x90.dk>2014-06-16 00:27:07 +0200
commit0331970d64db01bd2db0d86a253393938b2539f1 (patch)
tree51e72be3c00ca90e503e7f6e3ec3da84f96280ab /src/fe-common/core
parentd1e60a3b8f8a154a33e935279a6aeb356686efda (diff)
parenta8c52d8c1619e97a9f9a49ddc9c2c6a242cbb0ce (diff)
downloadirssi-0331970d64db01bd2db0d86a253393938b2539f1.zip
Merge pull request #24 from ailin-nemui/speedup
Speed up nicklist and window_find operations
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;
}