optimizations
This commit is contained in:
@@ -36,7 +36,7 @@ func Find(ctx context.Context, args ...object.Object) object.Object {
|
||||
|
||||
// find in array
|
||||
if haystack, ok := args[0].(*object.Array); ok {
|
||||
needle := args[1].(object.Comparable)
|
||||
needle := args[1]
|
||||
i := sort.Search(len(haystack.Elements), func(i int) bool {
|
||||
return needle.Compare(haystack.Elements[i]) == 0
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user