We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c2cfbb commit ef8720aCopy full SHA for ef8720a
projects/RabbitMQ.Client/client/impl/WireFormatting.cs
@@ -498,7 +498,11 @@ public static int GetFieldValueByteCount(object value)
498
}
499
500
[MethodImpl(MethodImplOptions.AggressiveInlining)]
501
+#if NETCOREAPP
502
+ public static int GetUTF8ByteCount(ReadOnlySpan<char> val) => val.IsEmpty ? 0 : Encoding.UTF8.GetByteCount(val);
503
+#else
504
public static int GetUTF8ByteCount(string val) => string.IsNullOrEmpty(val) ? 0 : Encoding.UTF8.GetByteCount(val);
505
+#endif
506
507
508
public static int WriteLong(Span<byte> span, uint val)
0 commit comments