diff options
Diffstat (limited to 'csharp/src/Google.Protobuf/Collections')
-rw-r--r-- | csharp/src/Google.Protobuf/Collections/MapField.cs | 7 | ||||
-rw-r--r-- | csharp/src/Google.Protobuf/Collections/RepeatedField.cs | 4 |
2 files changed, 2 insertions, 9 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index 0f7227c2..9f460e1e 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -54,7 +54,6 @@ namespace Google.Protobuf.Collections { // TODO: Don't create the map/list until we have an entry. (Assume many maps will be empty.) private readonly bool allowNullValues; - private bool frozen; private readonly Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>> map = new Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>>(); private readonly LinkedList<KeyValuePair<TKey, TValue>> list = new LinkedList<KeyValuePair<TKey, TValue>>(); @@ -254,7 +253,7 @@ namespace Google.Protobuf.Collections public bool AllowsNullValues { get { return allowNullValues; } } public int Count { get { return list.Count; } } - public bool IsReadOnly { get { return frozen; } } + public bool IsReadOnly { get { return false; } } public override bool Equals(object other) { @@ -416,10 +415,6 @@ namespace Google.Protobuf.Collections set { - if (frozen) - { - throw new NotSupportedException("Dictionary is frozen"); - } this[(TKey)key] = (TValue)value; } } diff --git a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs index e7fc0a3f..3ce19c81 100644 --- a/csharp/src/Google.Protobuf/Collections/RepeatedField.cs +++ b/csharp/src/Google.Protobuf/Collections/RepeatedField.cs @@ -40,7 +40,7 @@ namespace Google.Protobuf.Collections { /// <summary> /// The contents of a repeated field: essentially, a collection with some extra - /// restrictions (no null values) and capabilities (deep cloning and freezing). + /// restrictions (no null values) and capabilities (deep cloning). /// </summary> /// <typeparam name="T">The element type of the repeated field.</typeparam> public sealed class RepeatedField<T> : IList<T>, IList, IDeepCloneable<RepeatedField<T>>, IEquatable<RepeatedField<T>> @@ -48,7 +48,6 @@ namespace Google.Protobuf.Collections private static readonly T[] EmptyArray = new T[0]; private const int MinArraySize = 8; - private bool frozen; private T[] array = EmptyArray; private int count = 0; @@ -66,7 +65,6 @@ namespace Google.Protobuf.Collections public RepeatedField<T> Clone() { RepeatedField<T> clone = new RepeatedField<T>(); - // Clone is implicitly *not* frozen, even if this object is. if (array != EmptyArray) { clone.array = (T[])array.Clone(); |