Commit f0327166 authored by Jon Skeet's avatar Jon Skeet

More freezing tidy-up; generated code in next commit.

parent 3b2fe97b
...@@ -40,7 +40,7 @@ namespace Google.Protobuf.Collections ...@@ -40,7 +40,7 @@ namespace Google.Protobuf.Collections
{ {
/// <summary> /// <summary>
/// The contents of a repeated field: essentially, a collection with some extra /// 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> /// </summary>
/// <typeparam name="T">The element type of the repeated field.</typeparam> /// <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>> public sealed class RepeatedField<T> : IList<T>, IList, IDeepCloneable<RepeatedField<T>>, IEquatable<RepeatedField<T>>
...@@ -65,7 +65,6 @@ namespace Google.Protobuf.Collections ...@@ -65,7 +65,6 @@ namespace Google.Protobuf.Collections
public RepeatedField<T> Clone() public RepeatedField<T> Clone()
{ {
RepeatedField<T> clone = new RepeatedField<T>(); RepeatedField<T> clone = new RepeatedField<T>();
// Clone is implicitly *not* frozen, even if this object is.
if (array != EmptyArray) if (array != EmptyArray)
{ {
clone.array = (T[])array.Clone(); clone.array = (T[])array.Clone();
......
...@@ -134,9 +134,7 @@ void MessageGenerator::Generate(io::Printer* printer) { ...@@ -134,9 +134,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
"pbr::MessageDescriptor pb::IMessage.Descriptor {\n" "pbr::MessageDescriptor pb::IMessage.Descriptor {\n"
" get { return Descriptor; }\n" " get { return Descriptor; }\n"
"}\n" "}\n"
"\n" "\n");
"private bool _frozen = false;\n"
"public bool IsFrozen { get { return _frozen; } }\n\n");
// Parameterless constructor and partial OnConstruction method. // Parameterless constructor and partial OnConstruction method.
printer->Print( printer->Print(
......
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