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:
YenForYang 2021-09-10 17:26:43 -05:00 committed by GitHub
parent 6c9a7fec39
commit d957502528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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) {