From cf759883aa5c27c7bb00f0d3a2479f6ef689e87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Fri, 16 Dec 2016 23:17:15 +0100 Subject: [PATCH] Slice the params instead of building a new channel slice in the PART handler --- server/irc_handler.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/server/irc_handler.go b/server/irc_handler.go index 544f01db..e9ad7539 100644 --- a/server/irc_handler.go +++ b/server/irc_handler.go @@ -84,18 +84,11 @@ func (i *ircHandler) join(msg *irc.Message) { } func (i *ircHandler) part(msg *irc.Message) { - var chans []string - for i, param := range msg.Params { - if i != len(msg.Params)-1 { - chans = append(chans, param) - } - } - i.session.sendJSON("part", Part{ Join: Join{ Server: i.client.Host, User: msg.Nick, - Channels: chans, + Channels: msg.Params[:len(msg.Params)-1], }, Reason: msg.Params[len(msg.Params)-1], })