MCPcopy Index your code
hub / github.com/expr-lang/expr / estimateFnArgsCount

Function estimateFnArgsCount

vm/vm.go:795–805  ·  view source on GitHub ↗

estimateFnArgsCount inspects a *Program and estimates how many function arguments will be required to run it.

(program *Program)

Source from the content-addressed store, hash-verified

793// estimateFnArgsCount inspects a *Program and estimates how many function
794// arguments will be required to run it.
795func estimateFnArgsCount(program *Program) int {
796 // Implementation note: a program will not necessarily go through all
797 // operations, but this is just an estimation
798 var count int
799 for _, op := range program.Bytecode {
800 if int(op) < len(opArgLenEstimation) {
801 count += opArgLenEstimation[op]
802 }
803 }
804 return count
805}
806
807var opArgLenEstimation = [...]int{
808 OpCall1: 1,

Callers 1

getArgsForFuncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…