Commit 42b48bd5 authored by Wouter van Oortmerssen's avatar Wouter van Oortmerssen

Merge pull request #776 from belldon/bytebuffer_pos_fix

Extend C# ByteBuffer Put method fix to unsafe methods
parents 8bb45dc0 8db90f50
...@@ -168,7 +168,6 @@ namespace FlatBuffers ...@@ -168,7 +168,6 @@ namespace FlatBuffers
? value ? value
: ReverseBytes(value); : ReverseBytes(value);
} }
_pos = offset;
} }
public void PutInt(int offset, int value) public void PutInt(int offset, int value)
...@@ -185,7 +184,6 @@ namespace FlatBuffers ...@@ -185,7 +184,6 @@ namespace FlatBuffers
? value ? value
: ReverseBytes(value); : ReverseBytes(value);
} }
_pos = offset;
} }
public unsafe void PutLong(int offset, long value) public unsafe void PutLong(int offset, long value)
...@@ -203,7 +201,6 @@ namespace FlatBuffers ...@@ -203,7 +201,6 @@ namespace FlatBuffers
? value ? value
: ReverseBytes(value); : ReverseBytes(value);
} }
_pos = offset;
} }
public unsafe void PutFloat(int offset, float value) public unsafe void PutFloat(int offset, float value)
...@@ -220,7 +217,6 @@ namespace FlatBuffers ...@@ -220,7 +217,6 @@ namespace FlatBuffers
*(uint*)(ptr + offset) = ReverseBytes(*(uint*)(&value)); *(uint*)(ptr + offset) = ReverseBytes(*(uint*)(&value));
} }
} }
_pos = offset;
} }
public unsafe void PutDouble(int offset, double value) public unsafe void PutDouble(int offset, double value)
...@@ -238,7 +234,6 @@ namespace FlatBuffers ...@@ -238,7 +234,6 @@ namespace FlatBuffers
*(ulong*)(ptr + offset) = ReverseBytes(*(ulong*)(ptr + offset)); *(ulong*)(ptr + offset) = ReverseBytes(*(ulong*)(ptr + offset));
} }
} }
_pos = offset;
} }
#else // !UNSAFE_BYTEBUFFER #else // !UNSAFE_BYTEBUFFER
// Slower versions of Put* for when unsafe code is not allowed. // Slower versions of Put* for when unsafe code is not allowed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment