From 4c16661ac28e9e28866234919eb69241d7951891 Mon Sep 17 00:00:00 2001 From: deepdring Date: Thu, 14 Aug 2025 22:35:07 +0800 Subject: [PATCH] core: use slices.Contains Signed-off-by: deepdring --- core/filtermaps/matcher_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/filtermaps/matcher_test.go b/core/filtermaps/matcher_test.go index 5a49ce66ec..26d295913f 100644 --- a/core/filtermaps/matcher_test.go +++ b/core/filtermaps/matcher_test.go @@ -20,6 +20,7 @@ import ( "context" crand "crypto/rand" "math/rand" + "slices" "testing" "github.com/ethereum/go-ethereum/common" @@ -74,11 +75,8 @@ func TestMatcher(t *testing.T) { t.Fatalf("Log search error: %v", err) } var found bool - for _, l := range logs { - if l == log { - found = true - break - } + if slices.Contains(logs, log) { + found = true } if !found { t.Fatalf("Log search did not return expected log (addresses: %v, topics: %v, expected log: %v)", addresses, topics, *log)