Commit 3b2fe97b authored by Jon Skeet's avatar Jon Skeet

Minor bits of left-over frozenness.

parent 7a0effb9
...@@ -54,7 +54,6 @@ namespace Google.Protobuf.Collections ...@@ -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.) // TODO: Don't create the map/list until we have an entry. (Assume many maps will be empty.)
private readonly bool allowNullValues; private readonly bool allowNullValues;
private bool frozen;
private readonly Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>> map = private readonly Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>> map =
new Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>>(); new Dictionary<TKey, LinkedListNode<KeyValuePair<TKey, TValue>>>();
private readonly LinkedList<KeyValuePair<TKey, TValue>> list = new LinkedList<KeyValuePair<TKey, TValue>>(); private readonly LinkedList<KeyValuePair<TKey, TValue>> list = new LinkedList<KeyValuePair<TKey, TValue>>();
...@@ -254,7 +253,7 @@ namespace Google.Protobuf.Collections ...@@ -254,7 +253,7 @@ namespace Google.Protobuf.Collections
public bool AllowsNullValues { get { return allowNullValues; } } public bool AllowsNullValues { get { return allowNullValues; } }
public int Count { get { return list.Count; } } 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) public override bool Equals(object other)
{ {
...@@ -416,10 +415,6 @@ namespace Google.Protobuf.Collections ...@@ -416,10 +415,6 @@ namespace Google.Protobuf.Collections
set set
{ {
if (frozen)
{
throw new NotSupportedException("Dictionary is frozen");
}
this[(TKey)key] = (TValue)value; this[(TKey)key] = (TValue)value;
} }
} }
......
...@@ -48,7 +48,6 @@ namespace Google.Protobuf.Collections ...@@ -48,7 +48,6 @@ namespace Google.Protobuf.Collections
private static readonly T[] EmptyArray = new T[0]; private static readonly T[] EmptyArray = new T[0];
private const int MinArraySize = 8; private const int MinArraySize = 8;
private bool frozen;
private T[] array = EmptyArray; private T[] array = EmptyArray;
private int count = 0; private int count = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment