]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Prevent allocation when checking interface (#649)
authorYenForYang <YenForYang@users.noreply.github.com>
Sat, 18 Sep 2021 02:36:25 +0000 (21:36 -0500)
committerGitHub <noreply@github.com>
Sat, 18 Sep 2021 02:36:25 +0000 (12:36 +1000)
bencode/bytes.go

index b196963bdd40c7f4f74609246d0ec2fd18da1aca..5e1018e406779879197bcb3502c31b880c77b41a 100644 (file)
@@ -3,8 +3,8 @@ package bencode
 type Bytes []byte
 
 var (
-       _ Unmarshaler = &Bytes{}
-       _ Marshaler   = &Bytes{}
+       _ Unmarshaler = (*Bytes)(nil)
+       _ Marshaler   = (*Bytes)(nil)
        _ Marshaler   = Bytes{}
 )