all: use slices.Contains to simplify code

Change-Id: I9ef075bbb0e3c65f3c2a9d49e599ef50b18aa9be
Reviewed-on: https://go-review.googlesource.com/c/go/+/639535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
yuhan6665
2025-05-10 15:25:00 -04:00
parent c25bcef61f
commit 34e6b086a0
+1 -6
View File
@@ -1004,12 +1004,7 @@ func (hs *serverHandshakeStateTLS13) shouldSendSessionTickets() bool {
}
// Don't send tickets the client wouldn't use. See RFC 8446, Section 4.2.9.
for _, pskMode := range hs.clientHello.pskModes {
if pskMode == pskModeDHE {
return true
}
}
return false
return slices.Contains(hs.clientHello.pskModes, pskModeDHE)
}
func (hs *serverHandshakeStateTLS13) sendSessionTickets() error {