From b18d3dd8a4b426ebedcf279b593e85ac4985b9d3 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 4 Oct 2022 14:50:44 +0000 Subject: [PATCH] secure/precis: replace bytes.Compare with bytes.Equal Change-Id: Ifa6ba05253b38e1cb3d5791e62b36a523fb68e52 GitHub-Last-Rev: 2d7de01c3d93285224e3c65f55845a316da8f4d0 GitHub-Pull-Request: golang/text#36 Reviewed-on: https://go-review.googlesource.com/c/text/+/438559 Run-TryBot: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov Auto-Submit: Dmitri Shuralyov --- secure/precis/profile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secure/precis/profile.go b/secure/precis/profile.go index 35bd6f0a5..bdd991bb9 100644 --- a/secure/precis/profile.go +++ b/secure/precis/profile.go @@ -316,7 +316,7 @@ func (p *Profile) Compare(a, b string) bool { return false } - return bytes.Compare(akey, bkey) == 0 + return bytes.Equal(akey, bkey) } // Allowed returns a runes.Set containing every rune that is a member of the