diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-01-15 11:28:17 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-01-28 15:13:52 +0100 |
commit | 5bd97b9630f0e6ab9046c9b68c164bff7f2d1972 (patch) | |
tree | 44655091448435de0d70e06bbd77870c03cc0c10 | |
parent | 498ee539ea6360a0d242a68f40117cf903b0862d (diff) | |
download | weechat-5bd97b9630f0e6ab9046c9b68c164bff7f2d1972.zip |
irc: make case insensitive comparison with a lower case string (issue #1872)
This is faster because with case insensitive comparison, the chars are
converted to lower case anyway before being compared.
-rw-r--r-- | src/plugins/irc/irc-ctcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c index 050b27fc8..c37bc150c 100644 --- a/src/plugins/irc/irc-ctcp.c +++ b/src/plugins/irc/irc-ctcp.c @@ -179,7 +179,7 @@ irc_ctcp_display_reply_from_nick (struct t_irc_server *server, time_t date, { pos_args++; } - if (weechat_strcasecmp (ptr_args + 1, "PING") == 0) + if (weechat_strcasecmp (ptr_args + 1, "ping") == 0) { pos_usec = strchr (pos_args, ' '); if (pos_usec) @@ -1064,7 +1064,7 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, } /* CTCP ACTION */ - if (weechat_strcasecmp (ptr_args + 1, "ACTION") == 0) + if (weechat_strcasecmp (ptr_args + 1, "action") == 0) { nick_is_me = (irc_server_strcasecmp (server, server->nick, nick) == 0); if (channel) @@ -1152,7 +1152,7 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, } } /* CTCP PING */ - else if (weechat_strcasecmp (ptr_args + 1, "PING") == 0) + else if (weechat_strcasecmp (ptr_args + 1, "ping") == 0) { reply = irc_ctcp_get_reply (server, ptr_args + 1); irc_ctcp_display_request (server, date, tags, command, channel, @@ -1179,7 +1179,7 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, } } /* CTCP DCC */ - else if (weechat_strcasecmp (ptr_args + 1, "DCC") == 0) + else if (weechat_strcasecmp (ptr_args + 1, "dcc") == 0) { irc_ctcp_recv_dcc (server, nick, pos_args, message); } |