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

Method at

tables.go:101–116  ·  view source on GitHub ↗
(k value)

Source from the content-addressed store, hash-verified

99}
100
101func (t *table) at(k value) value {
102 switch k := k.(type) {
103 case nil:
104 return nil
105 case float64:
106 if i := int(k); float64(i) == k { // OPT: Inlined copy of atInt.
107 if 0 < i && i <= len(t.array) {
108 return t.array[i-1]
109 }
110 return t.hash[k]
111 }
112 case string:
113 return t.hash[k]
114 }
115 return t.hash[k]
116}
117
118func (t *table) put(l *State, k, v value) {
119 switch k := k.(type) {

Callers 3

RawGetMethod · 0.80
RawGetValueMethod · 0.80
tableAtMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected