MCPcopy Index your code
hub / github.com/Shopify/go-lua / cached

Function cached

stack.go:237–249  ·  view source on GitHub ↗
(p *prototype, upValues []*upValue, base int)

Source from the content-addressed store, hash-verified

235}
236
237func cached(p *prototype, upValues []*upValue, base int) *luaClosure {
238 c := p.cache
239 if c != nil {
240 for i, uv := range p.upValues {
241 if uv.isLocal && !c.upValues[i].isInStackAt(base+uv.index) {
242 return nil
243 } else if !uv.isLocal && c.upValues[i].home != upValues[uv.index].home {
244 return nil
245 }
246 }
247 }
248 return c
249}
250
251func (l *State) callGo(f value, function int, resultCount int) {
252 l.checkStack(MinStack)

Callers 2

initFunction · 0.85
executeSwitchMethod · 0.85

Calls 1

isInStackAtMethod · 0.80

Tested by

no test coverage detected