Use MatchString instead of Match to save a []byte cast
This commit is contained in:
parent
e289ba93eb
commit
0cba792bc5
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user