Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions net/FlatBuffers/FlatBufferBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ public void AddOffset(int off)
if (off > Offset)
throw new ArgumentException();

if (off != 0)
off = Offset - off + sizeof(int);
off = Offset - off + sizeof(int);
PutInt(off);
}

Expand Down
6 changes: 1 addition & 5 deletions net/FlatBuffers/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ public static int __indirect(int offset, ByteBuffer bb)
// Create a .NET String from UTF-8 data stored inside the flatbuffer.
public string __string(int offset)
{
int stringOffset = bb.GetInt(offset);
if (stringOffset == 0)
return null;

offset += stringOffset;
offset += bb.GetInt(offset);
var len = bb.GetInt(offset);
var startPos = offset + sizeof(int);
return bb.GetStringUTF8(startPos, len);
Expand Down
Loading