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

Function newTableWithSize

tables.go:19–30  ·  view source on GitHub ↗
(arraySize, hashSize int)

Source from the content-addressed store, hash-verified

17func (t *table) atString(k string) value { return t.hash[k] }
18
19func newTableWithSize(arraySize, hashSize int) *table {
20 t := new(table)
21 if arraySize > 0 {
22 t.array = make([]value, arraySize)
23 }
24 if hashSize > 0 {
25 t.hash = make(map[value]value, hashSize)
26 } else {
27 t.hash = make(map[value]value)
28 }
29 return t
30}
31
32func (l *State) fastTagMethod(table *table, event tm) value {
33 if table == nil || table.flags&1<<event != 0 {

Callers 3

CreateTableMethod · 0.85
initFunction · 0.85
executeSwitchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected