Skip to content

Commit

Permalink
Avoid a needless copy when copying strings from LiteCore to .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
borrrden committed Apr 20, 2018
1 parent fe1c302 commit ad49eb8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/LiteCore/src/LiteCore.Shared/Interop/C4Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ public string CreateString()
return null;
}

var bytes = ToArrayFast();
return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
return Encoding.UTF8.GetString((byte*) buf, (int) size);
}

public byte[] ToArrayFast()
Expand Down

0 comments on commit ad49eb8

Please sign in to comment.