Skip to content

Commit

Permalink
remove trailing whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bollhals committed Jun 3, 2020
1 parent 2adff6d commit 063e604
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal ref struct ContentHeaderPropertyReader
private int _offset;
private int _bitMask;
private int _bits;

private ReadOnlySpan<byte> Span => _span.Slice(_offset);

public ContentHeaderPropertyReader(ReadOnlySpan<byte> span)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void WriteBit(bool bit)
{
WritePresence(bit);
}

public void WriteLong(uint val)
{
_offset += WireFormatting.WriteLong(Span, val);
Expand All @@ -96,7 +96,7 @@ public void WriteOctet(byte val)
{
_span[_offset++] = val;
}

public void WritePresence(bool present)
{
if (_bitMask == EndBitMask)
Expand All @@ -113,7 +113,7 @@ public void WritePresence(bool present)

_bitMask >>= 1;
}

public void WriteShort(ushort val)
{
_offset += WireFormatting.WriteShort(Span, val);
Expand All @@ -133,7 +133,7 @@ public void WriteTimestamp(AmqpTimestamp val)
{
_offset += WireFormatting.WriteTimestamp(Span, val);
}

private void WriteBits()
{
NetworkOrderSerializer.WriteUInt16(Span, _bitAccumulator);
Expand Down
6 changes: 3 additions & 3 deletions projects/RabbitMQ.Client/client/impl/Frame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ internal int GetMinimumBufferSize()
{
return 8 + GetMinimumPayloadBufferSize();
}

public override string ToString()
{
return $"(type={Type}, channel={Channel})";
Expand Down Expand Up @@ -304,13 +304,13 @@ public void Dispose()
ArrayPool<byte>.Shared.Return(segment.Array);
}
}

public override string ToString()
{
return $"(type={Type}, channel={Channel}, {Payload.Length} bytes of payload)";
}
}

internal enum FrameType : int
{
FrameMethod = Constants.FrameMethod,
Expand Down
6 changes: 3 additions & 3 deletions projects/RabbitMQ.Client/client/impl/MethodArgumentReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal ref struct MethodArgumentReader
private int _offset;
private int _bitMask;
private int _bits;

private ReadOnlySpan<byte> Span => _span.Slice(_offset);

public MethodArgumentReader(ReadOnlySpan<byte> span)
Expand Down Expand Up @@ -80,14 +80,14 @@ public byte[] ReadContent()
{
throw new NotSupportedException("ReadContent should not be called");
}

public uint ReadLong()
{
uint result = NetworkOrderDeserializer.ReadUInt32(Span);
_offset += 4;
return result;
}

public ulong ReadLonglong()
{
ulong result = NetworkOrderDeserializer.ReadUInt64(Span);
Expand Down
4 changes: 2 additions & 2 deletions projects/RabbitMQ.Client/client/impl/MethodArgumentWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void WriteBit(bool val)
}
_bitMask <<= 1;
}

public void EndBits()
{
if (_bitMask > 1)
Expand All @@ -96,7 +96,7 @@ public void WriteLonglong(ulong val)
{
_offset += WireFormatting.WriteLonglong(Span, val);
}

public void WriteLongstr(byte[] val)
{
_offset += WireFormatting.WriteLongstr(Span, val);
Expand Down
4 changes: 2 additions & 2 deletions projects/RabbitMQ.Client/client/impl/WireFormatting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,15 @@ public static int WriteTable(Span<byte> span, IDictionary<string, object> val)
{
bytesWritten += WriteShortstr(slice.Slice(bytesWritten), entry.Key);
bytesWritten += WriteFieldValue(slice.Slice(bytesWritten), entry.Value);
}
}
}
else
{
foreach (KeyValuePair<string, object> entry in val)
{
bytesWritten += WriteShortstr(slice.Slice(bytesWritten), entry.Key);
bytesWritten += WriteFieldValue(slice.Slice(bytesWritten), entry.Value);
}
}
}

NetworkOrderSerializer.WriteUInt32(span, (uint)bytesWritten);
Expand Down

0 comments on commit 063e604

Please sign in to comment.