MCPcopy Create free account
hub / github.com/dolthub/doltgresql / PeekDepth

Method PeekDepth

utils/stack.go:41–46  ·  view source on GitHub ↗

PeekDepth returns the n-th value from the top. PeekDepth(0) is equivalent to the standard Peek().

(depth int)

Source from the content-addressed store, hash-verified

39
40// PeekDepth returns the n-th value from the top. PeekDepth(0) is equivalent to the standard Peek().
41func (s *Stack[T]) PeekDepth(depth int) (value T) {
42 if len(s.values) <= depth {
43 return
44 }
45 return s.values[len(s.values)-(1+depth)]
46}
47
48// PeekReference returns a reference to the top value on the stack without removing it.
49func (s *Stack[T]) PeekReference() *T {

Callers 9

reconcileLabelsFunction · 0.80
GetCurrentLabelMethod · 0.80
GetVariableMethod · 0.80
ListVariablesMethod · 0.80
NewVariableAliasMethod · 0.80
UpdateRecordMethod · 0.80
OrMethod · 0.80
ExitOptionalScopeMethod · 0.80
ExitParenScopeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected