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

Method Insert

lua.go:591–596  ·  view source on GitHub ↗

Insert moves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. http://www.lua.org/manual/5.2/manual.html#lua_insert

(index int)

Source from the content-addressed store, hash-verified

589//
590// http://www.lua.org/manual/5.2/manual.html#lua_insert
591func (l *State) Insert(index int) {
592 apiCheckStackIndex(index, l.indexToValue(index))
593 i := l.callInfo.function + l.AbsIndex(index)
594 copy(l.stack[i+1:l.top+1], l.stack[i:l.top])
595 l.stack[i] = l.stack[l.top]
596}
597
598func (l *State) move(dest int, src value) { l.setIndexToValue(dest, src) }
599

Callers 5

upValueHelperFunction · 0.80
loadHelperFunction · 0.80
base.goFile · 0.80
PackageOpenFunction · 0.80
findFieldFunction · 0.80

Calls 3

indexToValueMethod · 0.95
AbsIndexMethod · 0.95
apiCheckStackIndexFunction · 0.85

Tested by

no test coverage detected