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

Method Remove

state.go:1582–1598  ·  view source on GitHub ↗
(index int)

Source from the content-addressed store, hash-verified

1580}
1581
1582func (ls *LState) Remove(index int) {
1583 reg := ls.indexToReg(index)
1584 top := ls.reg.Top()
1585 switch {
1586 case reg >= top:
1587 return
1588 case reg < ls.currentLocalBase():
1589 return
1590 case reg == top-1:
1591 ls.Pop(1)
1592 return
1593 }
1594 for i := reg; i < top-1; i++ {
1595 ls.reg.Set(i, ls.reg.Get(i+1))
1596 }
1597 ls.reg.SetTop(top - 1)
1598}
1599
1600/* }}} */
1601

Callers 1

CloseMethod · 0.45

Calls 7

indexToRegMethod · 0.95
currentLocalBaseMethod · 0.95
PopMethod · 0.95
TopMethod · 0.45
SetMethod · 0.45
GetMethod · 0.45
SetTopMethod · 0.45

Tested by

no test coverage detected