James Newton-King 4 лет назад
Родитель
Сommit
6cf068c439

+ 10 - 3
csharp/src/Google.Protobuf/Collections/MapField.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

+ 2 - 2
csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs

@@ -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);