From 1c05f12d971847c6292c069a31bf98a245b4a4e1 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 27 Jun 2019 19:20:43 +0200 Subject: [PATCH] nit: avoid ValueOf We only need TypeOf. --- p2p/host/eventbus/basic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/host/eventbus/basic.go b/p2p/host/eventbus/basic.go index 28df1d5c5e..a257873b6c 100644 --- a/p2p/host/eventbus/basic.go +++ b/p2p/host/eventbus/basic.go @@ -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()