Avoid allocating memory when checking interface (#588)
Not a big deal, but there isn't a need to allocate an object to check that `*Node` satisfies `bencode.Unmarshaler`.
This commit is contained in:
parent
6c9a7fec39
commit
d957502528
|
@ -11,7 +11,7 @@ import (
|
|||
type Node string
|
||||
|
||||
var (
|
||||
_ bencode.Unmarshaler = new(Node)
|
||||
_ bencode.Unmarshaler = (*Node)(nil)
|
||||
)
|
||||
|
||||
func (n *Node) UnmarshalBencode(b []byte) (err error) {
|
||||
|
|
Loading…
Reference in New Issue