Commit dcb9614d authored by Felix Lange's avatar Felix Lange

common: drop unused kind field from Value

This makes Value 24 bytes smaller on 64bit systems.
parent f7d1d601
...@@ -26,10 +26,7 @@ import ( ...@@ -26,10 +26,7 @@ import (
// Value is useful whenever you feel that Go's types limit your // Value is useful whenever you feel that Go's types limit your
// ability to express yourself. In these situations, use Value and // ability to express yourself. In these situations, use Value and
// forget about this strong typing nonsense. // forget about this strong typing nonsense.
type Value struct { type Value struct{ Val interface{} }
Val interface{}
kind reflect.Value
}
func (val *Value) String() string { func (val *Value) String() string {
return fmt.Sprintf("%x", val.Val) return fmt.Sprintf("%x", val.Val)
...@@ -53,7 +50,6 @@ func (val *Value) IsNil() bool { ...@@ -53,7 +50,6 @@ func (val *Value) IsNil() bool {
} }
func (val *Value) Len() int { func (val *Value) Len() int {
//return val.kind.Len()
if data, ok := val.Val.([]interface{}); ok { if data, ok := val.Val.([]interface{}); ok {
return len(data) return len(data)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment