pull/8143/head
James Newton-King 4 years ago
parent e9cc0b0c23
commit 6cf068c439
No known key found for this signature in database
GPG Key ID: A66B2F456BF5526
  1. 13
      csharp/src/Google.Protobuf/Collections/MapField.cs
  2. 4
      csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs

@ -657,12 +657,19 @@ namespace Google.Protobuf.Collections
}
/// <summary>
/// The tag used in the enclosing message to indicate map entries.
/// The key codec.
/// </summary>
internal uint MapTag { get { return mapTag; } }
internal FieldCodec<TKey> KeyCodec => keyCodec;
/// <summary>
/// The value codec.
/// </summary>
internal FieldCodec<TValue> ValueCodec => valueCodec;
/// <summary>
/// The tag used in the enclosing message to indicate map entries.
/// </summary>
internal uint MapTag => mapTag;
}
private class MapView<T> : ICollection<T>, ICollection

@ -46,6 +46,8 @@ namespace Google.Protobuf
[SecuritySafeCritical]
internal static class ParsingPrimitivesMessages
{
private static readonly byte[] ZeroLengthMessageStreamData = new byte[] { 0 };
public static void SkipLastField(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
{
if (state.lastTag == 0)
@ -136,8 +138,6 @@ namespace Google.Protobuf
SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit);
}
private static readonly byte[] ZeroLengthMessageStreamData = new byte[] { 0 };
public static KeyValuePair<TKey, TValue> ReadMapEntry<TKey, TValue>(ref ParseContext ctx, MapField<TKey, TValue>.Codec codec)
{
int length = ParsingPrimitives.ParseLength(ref ctx.buffer, ref ctx.state);

Loading…
Cancel
Save