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

Method drop

interpreter/runtimecost.go:366–375  ·  view source on GitHub ↗

TODO: Allowing drop and dropArgs to remove stack items above the IDs they are provided is a workaround. drop and dropArgs should find and remove only the stack items matching the provided IDs once all attributes are properly pushed and popped from stack. drop searches the stack for each ID and remov

(ids ...int64)

Source from the content-addressed store, hash-verified

364// WARNING: It is possible for multiple expressions with the same ID to exist (due to how macros are implemented) so it's
365// possible that a dropped ID will remain on the stack. They should be removed when IDs on the stack are popped.
366func (s *refValStack) drop(ids ...int64) {
367 for _, id := range ids {
368 for idx := len(*s) - 1; idx >= 0; idx-- {
369 if (*s)[idx].ID == id {
370 *s = (*s)[:idx]
371 break
372 }
373 }
374 }
375}
376
377// dropArgs searches the stack for all the args by their IDs, accumulates their associated ref.Vals and drops any
378// stack items above any of the arg IDs. If any of the IDs are not found the stack, false is returned.

Callers 1

ObserveMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected