github.com/hirochachacha/plua@v0.0.0-20170217012138-c82f520cc725/internal/tables/util.go (about)

     1  package tables
     2  
     3  import "github.com/hirochachacha/plua/object"
     4  
     5  func normKey(key object.Value) object.Value {
     6  	if n, ok := key.(object.Number); ok {
     7  		i := object.Integer(n)
     8  		if object.Number(i) == n {
     9  			return i
    10  		}
    11  	}
    12  	return key
    13  }