From 78605e0253dc7678803d177a52f093fd0bbdb0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 13 Oct 2025 23:15:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20op=5Farrat.Has?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- op_array/array.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/op_array/array.go b/op_array/array.go index 02b8843..5722605 100644 --- a/op_array/array.go +++ b/op_array/array.go @@ -70,13 +70,13 @@ func (a *Array[Bt]) Unique(arr Array[Bt]) []Bt { } // Has 查询一个值是否在列表里, 在的话, 返回首次出现的索引, 不在返回-1 -func (a *Array[Bt]) Has(arr Array[Bt], input Bt) int { - for idx := 0; idx < len(arr.value); idx++ { - if reflect.TypeOf(arr.value[idx]).String() != reflect.TypeOf(input).String() { +func (a *Array[Bt]) Has(input Bt) int { + for idx := 0; idx < len(a.value); idx++ { + if reflect.TypeOf(a.value[idx]).String() != reflect.TypeOf(input).String() { // 类型不同 continue } - sourceByte, _ := json.Marshal(arr.value[idx]) + sourceByte, _ := json.Marshal(a.value[idx]) inputByte, _ := json.Marshal(input) if string(sourceByte) != string(inputByte) { continue