MCPcopy Index your code
hub / github.com/yuin/gopher-lua / closeUpvalues

Method closeUpvalues

_state.go:831–846  ·  view source on GitHub ↗
(idx int)

Source from the content-addressed store, hash-verified

829}
830
831func (ls *LState) closeUpvalues(idx int) { // +inline-start
832 if ls.uvcache != nil {
833 var prev *Upvalue
834 for uv := ls.uvcache; uv != nil; uv = uv.next {
835 if uv.index >= idx {
836 if prev != nil {
837 prev.next = nil
838 } else {
839 ls.uvcache = nil
840 }
841 uv.Close()
842 }
843 prev = uv
844 }
845 }
846} // +inline-end
847
848func (ls *LState) findUpvalue(idx int) *Upvalue {
849 var prev *Upvalue

Callers 1

closeAllUpvaluesMethod · 0.95

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected