mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
speed up window_item_find by interning name and removing call to channel_find
This commit is contained in:
parent
d1e60a3b8f
commit
a4c62a3fee
4 changed files with 3 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue