MCPcopy Create free account
hub / github.com/cel-expr/cel-go / PresenceTestHasCost

Function PresenceTestHasCost

interpreter/runtimecost.go:188–193  ·  view source on GitHub ↗

PresenceTestHasCost determines whether presence testing has a cost of one or zero. Defaults to presence test has a cost of one.

(hasCost bool)

Source from the content-addressed store, hash-verified

186// PresenceTestHasCost determines whether presence testing has a cost of one or zero.
187// Defaults to presence test has a cost of one.
188func PresenceTestHasCost(hasCost bool) CostTrackerOption {
189 return func(tracker *CostTracker) error {
190 tracker.presenceTestHasCost = hasCost
191 return nil
192 }
193}
194
195// NewCostTracker creates a new CostTracker with a given estimator and a set of functional CostTrackerOption values.
196func NewCostTracker(estimator ActualCostEstimator, opts ...CostTrackerOption) (*CostTracker, error) {

Callers 1

TestRuntimeCostFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestRuntimeCostFunction · 0.56