From 1e65fa58c11b78bd0b026583e9ba7f724a84d628 Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Thu, 29 Sep 2022 21:34:02 +0800 Subject: [PATCH] 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 --- src/encoding/json/fold.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 -- 2.50.0