diff --git a/src/ArtemisNetCoreClient/ArtemisBinaryConverter.cs b/src/ArtemisNetCoreClient/ArtemisBinaryConverter.cs index 7b68623..470a37b 100644 --- a/src/ArtemisNetCoreClient/ArtemisBinaryConverter.cs +++ b/src/ArtemisNetCoreClient/ArtemisBinaryConverter.cs @@ -232,7 +232,10 @@ public static int WriteString(ref byte destination, string value) var offset = WriteInt32(ref destination, length); if (value.Length < 9) { - offset += WriteAsShorts(ref destination.GetOffset(offset), value); + foreach (var c in value) + { + offset += WriteInt16(ref destination.GetOffset(offset), (short) c); + } } else if (value.Length < 0xFFF) { @@ -265,17 +268,6 @@ public static int WriteString(ref byte destination, string value) return offset; } - - private static int WriteAsShorts(ref byte destination, string value) - { - var offset = 0; - foreach (var c in value) - { - offset += WriteInt16(ref destination.GetOffset(offset), (short) c); - } - - return offset; - } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int GetNullableStringByteCount(string? value)