(idx int)
| 929 | } |
| 930 | |
| 931 | func (ls *LState) closeUpvalues(idx int) { // +inline-start |
| 932 | if ls.uvcache != nil { |
| 933 | var prev *Upvalue |
| 934 | for uv := ls.uvcache; uv != nil; uv = uv.next { |
| 935 | if uv.index >= idx { |
| 936 | if prev != nil { |
| 937 | prev.next = nil |
| 938 | } else { |
| 939 | ls.uvcache = nil |
| 940 | } |
| 941 | uv.Close() |
| 942 | } |
| 943 | prev = uv |
| 944 | } |
| 945 | } |
| 946 | } // +inline-end |
| 947 | |
| 948 | func (ls *LState) findUpvalue(idx int) *Upvalue { |
| 949 | var prev *Upvalue |