From 0cba792bc5ed88edfd2f9a6b8ebbf90a2960ab40 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 7 Mar 2016 02:11:59 -0500 Subject: [PATCH] Use MatchString instead of Match to save a []byte cast --- server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 5c9581b..4147cef 100644 --- a/server.go +++ b/server.go @@ -140,7 +140,7 @@ func (s *Server) handleCommand(client *Client, command string, args []string) { channels := strings.Split(args[0], ",") for _, channel := range channels { //Join the channel if it's valid - if channelRegexp.Match([]byte(channel)) { + if channelRegexp.MatchString(channel) { client.joinChannel(channel) } } @@ -161,7 +161,7 @@ func (s *Server) handleCommand(client *Client, command string, args []string) { channels := strings.Split(args[0], ",") for _, channel := range channels { //Part the channel if it's valid - if channelRegexp.Match([]byte(channel)) { + if channelRegexp.MatchString(channel) { client.partChannel(channel, reason) } }