Skip to content

Commit

Permalink
Add comment to clarify code intension. #213
Browse files Browse the repository at this point in the history
  • Loading branch information
yfakariya committed Feb 11, 2017
1 parent cc91838 commit 49f2c1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MsgPack/Packer.Packing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ private void PrivatePackCore( float value )

var bits = new Float32Bits( value );

// Float32Bits usage is effectively pointer dereference operation rather than shifting operators, so we must consider endianness here.
if ( BitConverter.IsLittleEndian )
{
this.WriteByte( bits.Byte3 );
Expand Down Expand Up @@ -1070,6 +1071,7 @@ private async Task PrivatePackAsyncCore( float value, CancellationToken cancella

var bits = new Float32Bits( value );

// Float32Bits usage is effectively pointer dereference operation rather than shifting operators, so we must consider endianness here.
if ( BitConverter.IsLittleEndian )
{
await this.WriteByteAsync( bits.Byte3, cancellationToken ).ConfigureAwait( false );
Expand Down
1 change: 1 addition & 0 deletions src/MsgPack/Packer.Packing.tt
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ foreach ( var isAsync in new [] { false, true } )

var bits = new Float32Bits( value );

// Float32Bits usage is effectively pointer dereference operation rather than shifting operators, so we must consider endianness here.
if ( BitConverter.IsLittleEndian )
{
<#
Expand Down

0 comments on commit 49f2c1e

Please sign in to comment.