MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / pop

Method pop

dql/math.go:33–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33func (s *mathTreeStack) pop() (*MathTree, error) {
34 if s.empty() {
35 return nil, errors.Errorf("Empty stack")
36 }
37 last := s.a[len(s.a)-1]
38 s.a = s.a[:len(s.a)-1]
39 return last, nil
40}
41
42func (s *mathTreeStack) peek() *MathTree {
43 x.AssertTruef(!s.empty(), "Trying to peek empty stack")

Callers 2

evalMathStackFunction · 0.45
parseMathFuncFunction · 0.45

Calls 2

emptyMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected