Skip to content

Commit de11524

Browse files
committed
fix .net framework compilation problem
1 parent b6a07fb commit de11524

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

csharp/src/Google.Protobuf/Collections/RepeatedField.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ private unsafe bool TryGetArrayAsSpanPinnedUnsafe(FieldCodec<T> codec, out Span<
711711
// 1. protobuf wire bytes is LittleEndian only
712712
// 2. validate that size of csharp element T is matching the size of protobuf wire size
713713
// NOTE: cannot use bool with this span because csharp marshal it as 4 bytes
714-
if (BitConverter.IsLittleEndian && (codec.FixedSize > 0 && Marshal.SizeOf<T>() == codec.FixedSize))
714+
if (BitConverter.IsLittleEndian && (codec.FixedSize > 0 && Marshal.SizeOf(typeof(T)) == codec.FixedSize))
715715
{
716716
handle = GCHandle.Alloc(array, GCHandleType.Pinned);
717717
span = new Span<byte>(handle.AddrOfPinnedObject().ToPointer(), array.Length * codec.FixedSize);

0 commit comments

Comments
 (0)