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

Method RawSetInt

lua.go:1123–1128  ·  view source on GitHub ↗

RawSetInt does the equivalent of table[n]=v where table is the table at index and v is the value at the top of the stack. This function pops the value from the stack. The assignment is raw; it doesn't invoke metamethods. http://www.lua.org/manual/5.2/manual.html#lua_rawseti

(index, key int)

Source from the content-addressed store, hash-verified

1121//
1122// http://www.lua.org/manual/5.2/manual.html#lua_rawseti
1123func (l *State) RawSetInt(index, key int) {
1124 l.checkElementCount(1)
1125 t := l.indexToValue(index).(*table)
1126 t.putAtInt(key, l.stack[l.top-1])
1127 l.top--
1128}
1129
1130// SetUserValue pops a table or nil from the stack and sets it as the new
1131// value associated to the userdata at index.

Callers 3

SwapMethod · 0.80
table.goFile · 0.80
createSearchersTableFunction · 0.80

Calls 3

checkElementCountMethod · 0.95
indexToValueMethod · 0.95
putAtIntMethod · 0.80

Tested by

no test coverage detected