Skip to content

Commit 904a54d

Browse files
committed
upstream: use strings.Cut when parsing ISUPPORT
1 parent 3bb807d commit 904a54d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

upstream.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,12 +996,11 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
996996
if strings.HasPrefix(token, "-") {
997997
negate = true
998998
token = token[1:]
999-
} else if i := strings.IndexByte(token, '='); i >= 0 {
1000-
parameter = token[:i]
1001-
value = xirc.DecodeIsupportValue(token[i+1:])
1002-
hasValue = true
999+
} else {
1000+
parameter, value, hasValue = strings.Cut(token, "=")
10031001
}
10041002
parameter = strings.ToUpper(parameter)
1003+
value = xirc.DecodeIsupportValue(value)
10051004

10061005
if hasValue {
10071006
uc.isupport[parameter] = &value

0 commit comments

Comments
 (0)