From 4cac1eb725aa0605f2c120a76b2b1825b0fed73e Mon Sep 17 00:00:00 2001 From: darkdrag00n Date: Tue, 1 Aug 2023 00:34:52 +0530 Subject: [PATCH] fix lint --- runtime/interpreter/value.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/interpreter/value.go b/runtime/interpreter/value.go index b0858ce317..782673d4a3 100644 --- a/runtime/interpreter/value.go +++ b/runtime/interpreter/value.go @@ -2989,10 +2989,8 @@ func (v *ArrayValue) Filter( return invocation } - iterator, err := v.array.Iterator() - i := 0 - err = v.array.Iterate( + err := v.array.Iterate( func(item atree.Value) (bool, error) { arrayElement := MustConvertStoredValue(interpreter, item) @@ -3013,6 +3011,11 @@ func (v *ArrayValue) Filter( panic(errors.NewExternalError(err)) } + iterator, err := v.array.Iterator() + if err != nil { + panic(errors.NewExternalError(err)) + } + return NewArrayValueWithIterator( interpreter, NewVariableSizedStaticType(interpreter, v.Type.ElementType()),