Files
expr/vm/utils.go
T
Anton MedvedevandGitHub b1e82de54a Refactor groupBy and sortBy (#562)
* Rearrange opcodes

* Refactor groupBy

* Fix tests

* Super opcodes for GroupBy

* Refactor sortBy builtin

* Fix sortBy bench
2024-02-15 19:53:35 +01:00

28 lines
411 B
Go

package vm
import (
"reflect"
)
type (
Function = func(params ...any) (any, error)
SafeFunction = func(params ...any) (any, uint, error)
)
var (
// MemoryBudget represents an upper limit of memory usage.
MemoryBudget uint = 1e6
errorType = reflect.TypeOf((*error)(nil)).Elem()
)
type Scope struct {
Array reflect.Value
Index int
Len int
Count int
Acc any
}
type groupBy = map[any][]any