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

Method addConstant

code.go:530–538  ·  view source on GitHub ↗
(k, v value)

Source from the content-addressed store, hash-verified

528}
529
530func (f *function) addConstant(k, v value) int {
531 if index, ok := f.constantLookup[k]; ok && f.f.constants[index] == v {
532 return index
533 }
534 index := len(f.f.constants)
535 f.constantLookup[k] = index
536 f.f.constants = append(f.f.constants, v)
537 return index
538}
539
540func (f *function) NumberConstant(n float64) int {
541 if n == 0.0 || math.IsNaN(n) {

Callers 4

NumberConstantMethod · 0.95
stringConstantMethod · 0.95
booleanConstantMethod · 0.95
nilConstantMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected