From: cuiweixie Date: Thu, 29 Sep 2022 13:34:02 +0000 (+0800) Subject: encoding/json: return comparison directly X-Git-Tag: go1.20rc1~779 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1e65fa58c11b78bd0b026583e9ba7f724a84d628;p=gostls13.git encoding/json: return comparison directly Change-Id: I4698d0fa78108d83ee91732e8d3878dbff7f9c90 Reviewed-on: https://go-review.googlesource.com/c/go/+/436711 TryBot-Result: Gopher Robot Run-TryBot: xie cui <523516579@qq.com> Reviewed-by: Dmitri Shuralyov Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Joseph Tsai --- diff --git a/src/encoding/json/fold.go b/src/encoding/json/fold.go index ab249b2bbe..0f9b09d712 100644 --- a/src/encoding/json/fold.go +++ b/src/encoding/json/fold.go @@ -97,10 +97,7 @@ func equalFoldRight(s, t []byte) bool { t = t[size:] } - if len(t) > 0 { - return false - } - return true + return len(t) == 0 } // asciiEqualFold is a specialization of bytes.EqualFold for use when