Skip to content

Commit 593c598

Browse files
committed
Code cleanup
1 parent bc8feea commit 593c598

2 files changed

Lines changed: 1 addition & 34 deletions

File tree

src/MsgPack/ByteBufferAllocator.cs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#endregion -- License Terms --
2020

2121
using System;
22-
using System.Collections.Generic;
2322

2423
namespace MsgPack
2524
{
@@ -30,36 +29,6 @@ internal abstract class ByteBufferAllocator
3029
{
3130
// This type should be public when the design is fixed for Span<byte>
3231

33-
public abstract bool TryAllocate( byte[] oldBuffer, int requestSize, out /* Span<byte> */byte[] newBuffer );
32+
public abstract bool TryAllocate( byte[] oldBuffer, int requestSize, out byte[] newBuffer );
3433
}
35-
36-
#warning TODO: SpanBufferAllocator
37-
// internal sealed class SpanBufferAllocator : ByteBufferAllocator
38-
// {
39-
// private readonly Func<int, Span<byte>> _allocator;
40-
41-
// public SpanBufferAllocator( Func<int, Span<byte>> allocator)
42-
// {
43-
// this._allocator = allocator;
44-
// }
45-
46-
// public override bool TryAllocate( IList<ArraySegment<byte>> arrayBuffers, IList<Span<byte>> spanBuffers, int sizeHint, ref int newCurrentBufferIndex, out Span<byte> newCurrentBuffer )
47-
// {
48-
//#if DEBUG
49-
// Contract.Assert( spanBuffers != null, "spanBuffers != null" );
50-
// Contract.Assert( !spanBuffers.IsReadOnly, "!spanBuffers.IsReadOnly" );
51-
//#endif // DEBUG
52-
// if ( spanBuffers.Count == Int32.MaxValue )
53-
// {
54-
// newCurrentBuffer = default( Span<byte> );
55-
// return false;
56-
// }
57-
58-
// var newBuffer = this._allocator( sizeHint );
59-
// spanBuffers.Add( newBuffer );
60-
// newCurrentBuffer = newBuffer;
61-
// newCurrentBufferIndex = spanBuffers.Count - 1;
62-
// return true;
63-
// }
64-
// }
6534
}

src/MsgPack/MessagePackByteArrayPacker.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ internal sealed partial class MessagePackByteArrayPacker : ByteArrayPacker
3636
{
3737
private const int MaximumUtf8Length = 4;
3838

39-
// TODO: Use Span<byte>
4039
private byte[] _buffer;
4140
private int _offset;
4241

43-
// TODO: Use Span<byte>;
4442
private readonly int _initialOffset;
4543
private readonly ByteBufferAllocator _allocator;
4644

0 commit comments

Comments
 (0)