让ByteArray的Encode不使用指针

This commit is contained in:
Tnze
2019-06-03 13:23:28 +08:00
parent 4a0dc34854
commit b8e2b66a35

View File

@ -359,8 +359,8 @@ func (n NBT) Decode(r DecodeReader) error {
} }
// Encode a ByteArray // Encode a ByteArray
func (b *ByteArray) Encode() []byte { func (b ByteArray) Encode() []byte {
return append(VarInt(len(*b)).Encode(), *b...) return append(VarInt(len(b)).Encode(), b...)
} }
// Decode a ByteArray // Decode a ByteArray