mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkReaderPool: use NetworkReader.SetBuffer
This commit is contained in:
parent
854ea1e5a3
commit
2f5ce11491
@ -28,8 +28,7 @@ public static PooledNetworkReader GetReader(byte[] bytes)
|
||||
{
|
||||
// grab from pool & set buffer
|
||||
PooledNetworkReader reader = Pool.Take();
|
||||
reader.buffer = new ArraySegment<byte>(bytes);
|
||||
reader.Position = 0;
|
||||
reader.SetBuffer(bytes);
|
||||
return reader;
|
||||
}
|
||||
|
||||
@ -38,8 +37,7 @@ public static PooledNetworkReader GetReader(ArraySegment<byte> segment)
|
||||
{
|
||||
// grab from pool & set buffer
|
||||
PooledNetworkReader reader = Pool.Take();
|
||||
reader.buffer = segment;
|
||||
reader.Position = 0;
|
||||
reader.SetBuffer(segment);
|
||||
return reader;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user