nit: avoid ValueOf

We only need TypeOf.
This commit is contained in:
Steven Allen 2019-06-27 19:20:43 +02:00
parent 9c3fe0580a
commit 12782426ed

View File

@ -230,9 +230,9 @@ func newNode(typ reflect.Type) *node {
}
func (n *node) emit(event interface{}) {
eval := reflect.ValueOf(event)
if eval.Type() != n.typ {
panic(fmt.Sprintf("Emit called with wrong type. expected: %s, got: %s", n.typ, eval.Type()))
typ := reflect.TypeOf(event)
if typ != n.typ {
panic(fmt.Sprintf("Emit called with wrong type. expected: %s, got: %s", n.typ, typ))
}
n.lk.RLock()