MCPcopy Create free account
hub / github.com/yuin/gopher-lua / Remove

Method Remove

_state.go:1369–1385  ·  view source on GitHub ↗
(index int)

Source from the content-addressed store, hash-verified

1367}
1368
1369func (ls *LState) Remove(index int) {
1370 reg := ls.indexToReg(index)
1371 top := ls.reg.Top()
1372 switch {
1373 case reg >= top:
1374 return
1375 case reg < ls.currentLocalBase():
1376 return
1377 case reg == top-1:
1378 ls.Pop(1)
1379 return
1380 }
1381 for i := reg; i < top-1; i++ {
1382 ls.reg.Set(i, ls.reg.Get(i+1))
1383 }
1384 ls.reg.SetTop(top - 1)
1385}
1386
1387/* }}} */
1388

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