Use MatchString instead of Match to save a []byte cast

This commit is contained in:
ed 2016-03-07 02:11:59 -05:00 committed by Harry Jeffery
parent e289ba93eb
commit 0cba792bc5

View File

@ -140,7 +140,7 @@ func (s *Server) handleCommand(client *Client, command string, args []string) {
channels := strings.Split(args[0], ",") channels := strings.Split(args[0], ",")
for _, channel := range channels { for _, channel := range channels {
//Join the channel if it's valid //Join the channel if it's valid
if channelRegexp.Match([]byte(channel)) { if channelRegexp.MatchString(channel) {
client.joinChannel(channel) client.joinChannel(channel)
} }
} }
@ -161,7 +161,7 @@ func (s *Server) handleCommand(client *Client, command string, args []string) {
channels := strings.Split(args[0], ",") channels := strings.Split(args[0], ",")
for _, channel := range channels { for _, channel := range channels {
//Part the channel if it's valid //Part the channel if it's valid
if channelRegexp.Match([]byte(channel)) { if channelRegexp.MatchString(channel) {
client.partChannel(channel, reason) client.partChannel(channel, reason)
} }
} }