bencode.Unmarshal: Remove unnecessary intermediate bufio.Reader

This commit is contained in:
Matt Joiner 2016-06-15 14:54:40 +10:00
parent 9d1a33facc
commit d9b7e7f297
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ func Marshal(v interface{}) ([]byte, error) {
// Unmarshal the bencode value in the 'data' to a value pointed by the 'v'
// pointer, return a non-nil error if any.
func Unmarshal(data []byte, v interface{}) error {
e := decoder{r: bufio.NewReader(bytes.NewBuffer(data))}
e := decoder{r: bytes.NewBuffer(data)}
return e.decode(v)
}