Skip to content

Commit ad49eb8

Browse files
committed
Avoid a needless copy when copying strings from LiteCore to .NET
1 parent fe1c302 commit ad49eb8

File tree

1 file changed

+1
-2
lines changed
  • src/LiteCore/src/LiteCore.Shared/Interop

1 file changed

+1
-2
lines changed

src/LiteCore/src/LiteCore.Shared/Interop/C4Base.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ public string CreateString()
119119
return null;
120120
}
121121

122-
var bytes = ToArrayFast();
123-
return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
122+
return Encoding.UTF8.GetString((byte*) buf, (int) size);
124123
}
125124

126125
public byte[] ToArrayFast()

0 commit comments

Comments
 (0)