Commit fb1547b3 authored by Jon Skeet's avatar Jon Skeet

Regenerate proto files

parent a8dae140
...@@ -130,39 +130,43 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -130,39 +130,43 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Id != 0) hash ^= Id.GetHashCode(); if (Id != 0) hash ^= Id.GetHashCode();
if (Email != "") hash ^= Email.GetHashCode(); if (Email.Length != 0) hash ^= Email.GetHashCode();
hash ^= phone_.GetHashCode(); hash ^= phone_.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
if (Id != 0) { if (Id != 0) {
output.WriteInt32(2, Id); output.WriteInt32(2, Id);
} }
if (Email != "") { if (Email.Length != 0) {
output.WriteString(3, Email); output.WriteString(3, Email);
} }
output.WriteMessageArray(4, phone_); if (phone_.Count > 0) {
output.WriteMessageArray(4, phone_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
if (Id != 0) { if (Id != 0) {
size += pb::CodedOutputStream.ComputeInt32Size(2, Id); size += pb::CodedOutputStream.ComputeInt32Size(2, Id);
} }
if (Email != "") { if (Email.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(3, Email); size += pb::CodedOutputStream.ComputeStringSize(3, Email);
} }
foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in phone_) { if (phone_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element); foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in phone_) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element);
}
} }
return size; return size;
} }
...@@ -170,13 +174,13 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -170,13 +174,13 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
if (other.Id != 0) { if (other.Id != 0) {
Id = other.Id; Id = other.Id;
} }
if (other.Email != "") { if (other.Email.Length != 0) {
Email = other.Email; Email = other.Email;
} }
phone_.Add(other.phone_); phone_.Add(other.phone_);
...@@ -194,15 +198,15 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -194,15 +198,15 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 16: { case 16: {
id_ = input.ReadInt32(); Id = input.ReadInt32();
break; break;
} }
case 26: { case 26: {
email_ = input.ReadString(); Email = input.ReadString();
break; break;
} }
case 34: { case 34: {
...@@ -275,13 +279,13 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -275,13 +279,13 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Number != "") hash ^= Number.GetHashCode(); if (Number.Length != 0) hash ^= Number.GetHashCode();
if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) hash ^= Type.GetHashCode(); if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) hash ^= Type.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Number != "") { if (Number.Length != 0) {
output.WriteString(1, Number); output.WriteString(1, Number);
} }
if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) { if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) {
...@@ -291,7 +295,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -291,7 +295,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Number != "") { if (Number.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Number); size += pb::CodedOutputStream.ComputeStringSize(1, Number);
} }
if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) { if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) {
...@@ -303,7 +307,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -303,7 +307,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Number != "") { if (other.Number.Length != 0) {
Number = other.Number; Number = other.Number;
} }
if (other.Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) { if (other.Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) {
...@@ -323,7 +327,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -323,7 +327,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
break; break;
case 10: { case 10: {
number_ = input.ReadString(); Number = input.ReadString();
break; break;
} }
case 16: { case 16: {
...@@ -388,13 +392,17 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -388,13 +392,17 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WriteMessageArray(1, person_); if (person_.Count > 0) {
output.WriteMessageArray(1, person_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in person_) { if (person_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element); foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in person_) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
} }
return size; return size;
} }
......
...@@ -141,7 +141,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -141,7 +141,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
d_ = input.ReadInt32(); D = input.ReadInt32();
break; break;
} }
} }
......
...@@ -126,7 +126,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -126,7 +126,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
e_ = input.ReadInt32(); E = input.ReadInt32();
break; break;
} }
} }
......
...@@ -157,8 +157,12 @@ namespace UnitTest.Issues.TestProtos { ...@@ -157,8 +157,12 @@ namespace UnitTest.Issues.TestProtos {
if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) { if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
output.WriteEnum(1, (int) Value); output.WriteEnum(1, (int) Value);
} }
output.WriteEnumArray(2, values_); if (values_.Count > 0) {
output.WritePackedEnumArray(3, packedValues_); output.WriteEnumArray(2, values_);
}
if (packedValues_.Count > 0) {
output.WritePackedEnumArray(3, packedValues_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -166,26 +170,22 @@ namespace UnitTest.Issues.TestProtos { ...@@ -166,26 +170,22 @@ namespace UnitTest.Issues.TestProtos {
if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) { if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Value); size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Value);
} }
{ if (values_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (values_.Count > 0) { foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in values_) {
foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in values_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 1 * values_.Count;
} }
size += dataSize;
size += 1 * values_.Count;
} }
{ if (packedValues_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (packedValues_.Count > 0) { foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in packedValues_) {
foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in packedValues_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 1;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
size += dataSize;
size += 1;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
return size; return size;
} }
...@@ -399,15 +399,21 @@ namespace UnitTest.Issues.TestProtos { ...@@ -399,15 +399,21 @@ namespace UnitTest.Issues.TestProtos {
if (PrimitiveValue != 0) { if (PrimitiveValue != 0) {
output.WriteInt32(1, PrimitiveValue); output.WriteInt32(1, PrimitiveValue);
} }
output.WritePackedInt32Array(2, primitiveArray_); if (primitiveArray_.Count > 0) {
output.WritePackedInt32Array(2, primitiveArray_);
}
if (messageValue_ != null) { if (messageValue_ != null) {
output.WriteMessage(3, MessageValue); output.WriteMessage(3, MessageValue);
} }
output.WriteMessageArray(4, messageArray_); if (messageArray_.Count > 0) {
output.WriteMessageArray(4, messageArray_);
}
if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) { if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
output.WriteEnum(5, (int) EnumValue); output.WriteEnum(5, (int) EnumValue);
} }
output.WritePackedEnumArray(6, enumArray_); if (enumArray_.Count > 0) {
output.WritePackedEnumArray(6, enumArray_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -415,35 +421,33 @@ namespace UnitTest.Issues.TestProtos { ...@@ -415,35 +421,33 @@ namespace UnitTest.Issues.TestProtos {
if (PrimitiveValue != 0) { if (PrimitiveValue != 0) {
size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveValue); size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveValue);
} }
{ if (primitiveArray_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in primitiveArray_) { foreach (int element in primitiveArray_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (primitiveArray_.Count != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
if (messageValue_ != null) { if (messageValue_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(3, MessageValue); size += pb::CodedOutputStream.ComputeMessageSize(3, MessageValue);
} }
foreach (global::UnitTest.Issues.TestProtos.DeprecatedChild element in messageArray_) { if (messageArray_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element); foreach (global::UnitTest.Issues.TestProtos.DeprecatedChild element in messageArray_) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element);
}
} }
if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) { if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
size += pb::CodedOutputStream.ComputeEnumSize(5, (int) EnumValue); size += pb::CodedOutputStream.ComputeEnumSize(5, (int) EnumValue);
} }
{ if (enumArray_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (enumArray_.Count > 0) { foreach (global::UnitTest.Issues.TestProtos.DeprecatedEnum element in enumArray_) {
foreach (global::UnitTest.Issues.TestProtos.DeprecatedEnum element in enumArray_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 1;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
size += dataSize;
size += 1;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
return size; return size;
} }
...@@ -480,7 +484,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -480,7 +484,7 @@ namespace UnitTest.Issues.TestProtos {
} }
break; break;
case 8: { case 8: {
primitiveValue_ = input.ReadInt32(); PrimitiveValue = input.ReadInt32();
break; break;
} }
case 18: case 18:
...@@ -596,7 +600,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -596,7 +600,7 @@ namespace UnitTest.Issues.TestProtos {
} }
break; break;
case 8: { case 8: {
item_ = input.ReadInt32(); Item = input.ReadInt32();
break; break;
} }
} }
......
...@@ -747,7 +747,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -747,7 +747,7 @@ namespace Google.Protobuf.TestProtos {
get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; }
set { set {
oneofField_ = value ?? ""; oneofField_ = value ?? "";
oneofFieldCase_ = value == null ? OneofFieldOneofCase.None : OneofFieldOneofCase.OneofString; oneofFieldCase_ = OneofFieldOneofCase.OneofString;
} }
} }
...@@ -756,7 +756,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -756,7 +756,7 @@ namespace Google.Protobuf.TestProtos {
get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; }
set { set {
oneofField_ = value ?? pb::ByteString.Empty; oneofField_ = value ?? pb::ByteString.Empty;
oneofFieldCase_ = value == null ? OneofFieldOneofCase.None : OneofFieldOneofCase.OneofBytes; oneofFieldCase_ = OneofFieldOneofCase.OneofBytes;
} }
} }
...@@ -850,8 +850,8 @@ namespace Google.Protobuf.TestProtos { ...@@ -850,8 +850,8 @@ namespace Google.Protobuf.TestProtos {
if (SingleFloat != 0F) hash ^= SingleFloat.GetHashCode(); if (SingleFloat != 0F) hash ^= SingleFloat.GetHashCode();
if (SingleDouble != 0D) hash ^= SingleDouble.GetHashCode(); if (SingleDouble != 0D) hash ^= SingleDouble.GetHashCode();
if (SingleBool != false) hash ^= SingleBool.GetHashCode(); if (SingleBool != false) hash ^= SingleBool.GetHashCode();
if (SingleString != "") hash ^= SingleString.GetHashCode(); if (SingleString.Length != 0) hash ^= SingleString.GetHashCode();
if (SingleBytes != pb::ByteString.Empty) hash ^= SingleBytes.GetHashCode(); if (SingleBytes.Length != 0) hash ^= SingleBytes.GetHashCode();
if (singleNestedMessage_ != null) hash ^= SingleNestedMessage.GetHashCode(); if (singleNestedMessage_ != null) hash ^= SingleNestedMessage.GetHashCode();
if (singleForeignMessage_ != null) hash ^= SingleForeignMessage.GetHashCode(); if (singleForeignMessage_ != null) hash ^= SingleForeignMessage.GetHashCode();
if (singleImportMessage_ != null) hash ^= SingleImportMessage.GetHashCode(); if (singleImportMessage_ != null) hash ^= SingleImportMessage.GetHashCode();
...@@ -928,10 +928,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -928,10 +928,10 @@ namespace Google.Protobuf.TestProtos {
if (SingleBool != false) { if (SingleBool != false) {
output.WriteBool(13, SingleBool); output.WriteBool(13, SingleBool);
} }
if (SingleString != "") { if (SingleString.Length != 0) {
output.WriteString(14, SingleString); output.WriteString(14, SingleString);
} }
if (SingleBytes != pb::ByteString.Empty) { if (SingleBytes.Length != 0) {
output.WriteBytes(15, SingleBytes); output.WriteBytes(15, SingleBytes);
} }
if (singleNestedMessage_ != null) { if (singleNestedMessage_ != null) {
...@@ -955,28 +955,72 @@ namespace Google.Protobuf.TestProtos { ...@@ -955,28 +955,72 @@ namespace Google.Protobuf.TestProtos {
if (singlePublicImportMessage_ != null) { if (singlePublicImportMessage_ != null) {
output.WriteMessage(26, SinglePublicImportMessage); output.WriteMessage(26, SinglePublicImportMessage);
} }
output.WritePackedInt32Array(31, repeatedInt32_); if (repeatedInt32_.Count > 0) {
output.WritePackedInt64Array(32, repeatedInt64_); output.WritePackedInt32Array(31, repeatedInt32_);
output.WritePackedUInt32Array(33, repeatedUint32_); }
output.WritePackedUInt64Array(34, repeatedUint64_); if (repeatedInt64_.Count > 0) {
output.WritePackedSInt32Array(35, repeatedSint32_); output.WritePackedInt64Array(32, repeatedInt64_);
output.WritePackedSInt64Array(36, repeatedSint64_); }
output.WritePackedFixed32Array(37, repeatedFixed32_); if (repeatedUint32_.Count > 0) {
output.WritePackedFixed64Array(38, repeatedFixed64_); output.WritePackedUInt32Array(33, repeatedUint32_);
output.WritePackedSFixed32Array(39, repeatedSfixed32_); }
output.WritePackedSFixed64Array(40, repeatedSfixed64_); if (repeatedUint64_.Count > 0) {
output.WritePackedFloatArray(41, repeatedFloat_); output.WritePackedUInt64Array(34, repeatedUint64_);
output.WritePackedDoubleArray(42, repeatedDouble_); }
output.WritePackedBoolArray(43, repeatedBool_); if (repeatedSint32_.Count > 0) {
output.WriteStringArray(44, repeatedString_); output.WritePackedSInt32Array(35, repeatedSint32_);
output.WriteBytesArray(45, repeatedBytes_); }
output.WriteMessageArray(48, repeatedNestedMessage_); if (repeatedSint64_.Count > 0) {
output.WriteMessageArray(49, repeatedForeignMessage_); output.WritePackedSInt64Array(36, repeatedSint64_);
output.WriteMessageArray(50, repeatedImportMessage_); }
output.WritePackedEnumArray(51, repeatedNestedEnum_); if (repeatedFixed32_.Count > 0) {
output.WritePackedEnumArray(52, repeatedForeignEnum_); output.WritePackedFixed32Array(37, repeatedFixed32_);
output.WritePackedEnumArray(53, repeatedImportEnum_); }
output.WriteMessageArray(54, repeatedPublicImportMessage_); if (repeatedFixed64_.Count > 0) {
output.WritePackedFixed64Array(38, repeatedFixed64_);
}
if (repeatedSfixed32_.Count > 0) {
output.WritePackedSFixed32Array(39, repeatedSfixed32_);
}
if (repeatedSfixed64_.Count > 0) {
output.WritePackedSFixed64Array(40, repeatedSfixed64_);
}
if (repeatedFloat_.Count > 0) {
output.WritePackedFloatArray(41, repeatedFloat_);
}
if (repeatedDouble_.Count > 0) {
output.WritePackedDoubleArray(42, repeatedDouble_);
}
if (repeatedBool_.Count > 0) {
output.WritePackedBoolArray(43, repeatedBool_);
}
if (repeatedString_.Count > 0) {
output.WriteStringArray(44, repeatedString_);
}
if (repeatedBytes_.Count > 0) {
output.WriteBytesArray(45, repeatedBytes_);
}
if (repeatedNestedMessage_.Count > 0) {
output.WriteMessageArray(48, repeatedNestedMessage_);
}
if (repeatedForeignMessage_.Count > 0) {
output.WriteMessageArray(49, repeatedForeignMessage_);
}
if (repeatedImportMessage_.Count > 0) {
output.WriteMessageArray(50, repeatedImportMessage_);
}
if (repeatedNestedEnum_.Count > 0) {
output.WritePackedEnumArray(51, repeatedNestedEnum_);
}
if (repeatedForeignEnum_.Count > 0) {
output.WritePackedEnumArray(52, repeatedForeignEnum_);
}
if (repeatedImportEnum_.Count > 0) {
output.WritePackedEnumArray(53, repeatedImportEnum_);
}
if (repeatedPublicImportMessage_.Count > 0) {
output.WriteMessageArray(54, repeatedPublicImportMessage_);
}
if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) {
output.WriteUInt32(111, OneofUint32); output.WriteUInt32(111, OneofUint32);
} }
...@@ -1032,10 +1076,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1032,10 +1076,10 @@ namespace Google.Protobuf.TestProtos {
if (SingleBool != false) { if (SingleBool != false) {
size += pb::CodedOutputStream.ComputeBoolSize(13, SingleBool); size += pb::CodedOutputStream.ComputeBoolSize(13, SingleBool);
} }
if (SingleString != "") { if (SingleString.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(14, SingleString); size += pb::CodedOutputStream.ComputeStringSize(14, SingleString);
} }
if (SingleBytes != pb::ByteString.Empty) { if (SingleBytes.Length != 0) {
size += pb::CodedOutputStream.ComputeBytesSize(15, SingleBytes); size += pb::CodedOutputStream.ComputeBytesSize(15, SingleBytes);
} }
if (singleNestedMessage_ != null) { if (singleNestedMessage_ != null) {
...@@ -1059,123 +1103,97 @@ namespace Google.Protobuf.TestProtos { ...@@ -1059,123 +1103,97 @@ namespace Google.Protobuf.TestProtos {
if (singlePublicImportMessage_ != null) { if (singlePublicImportMessage_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(26, SinglePublicImportMessage); size += pb::CodedOutputStream.ComputeMessageSize(26, SinglePublicImportMessage);
} }
{ if (repeatedInt32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in repeatedInt32_) { foreach (int element in repeatedInt32_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedInt32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedInt64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (long element in repeatedInt64_) { foreach (long element in repeatedInt64_) {
dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedInt64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedUint32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (uint element in repeatedUint32_) { foreach (uint element in repeatedUint32_) {
dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedUint32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedUint64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (ulong element in repeatedUint64_) { foreach (ulong element in repeatedUint64_) {
dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedUint64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedSint32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in repeatedSint32_) { foreach (int element in repeatedSint32_) {
dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedSint32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedSint64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (long element in repeatedSint64_) { foreach (long element in repeatedSint64_) {
dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedSint64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedFixed32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * repeatedFixed32_.Count; dataSize = 4 * repeatedFixed32_.Count;
size += dataSize; size += dataSize;
if (repeatedFixed32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedFixed64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * repeatedFixed64_.Count; dataSize = 8 * repeatedFixed64_.Count;
size += dataSize; size += dataSize;
if (repeatedFixed64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedSfixed32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * repeatedSfixed32_.Count; dataSize = 4 * repeatedSfixed32_.Count;
size += dataSize; size += dataSize;
if (repeatedSfixed32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedSfixed64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * repeatedSfixed64_.Count; dataSize = 8 * repeatedSfixed64_.Count;
size += dataSize; size += dataSize;
if (repeatedSfixed64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedFloat_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * repeatedFloat_.Count; dataSize = 4 * repeatedFloat_.Count;
size += dataSize; size += dataSize;
if (repeatedFloat_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedDouble_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * repeatedDouble_.Count; dataSize = 8 * repeatedDouble_.Count;
size += dataSize; size += dataSize;
if (repeatedDouble_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedBool_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 1 * repeatedBool_.Count; dataSize = 1 * repeatedBool_.Count;
size += dataSize; size += dataSize;
if (repeatedBool_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedString_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (string element in repeatedString_) { foreach (string element in repeatedString_) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
...@@ -1183,7 +1201,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -1183,7 +1201,7 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * repeatedString_.Count; size += 2 * repeatedString_.Count;
} }
{ if (repeatedBytes_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (pb::ByteString element in repeatedBytes_) { foreach (pb::ByteString element in repeatedBytes_) {
dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element);
...@@ -1191,50 +1209,52 @@ namespace Google.Protobuf.TestProtos { ...@@ -1191,50 +1209,52 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * repeatedBytes_.Count; size += 2 * repeatedBytes_.Count;
} }
foreach (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage element in repeatedNestedMessage_) { if (repeatedNestedMessage_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(48, element); foreach (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage element in repeatedNestedMessage_) {
size += pb::CodedOutputStream.ComputeMessageSize(48, element);
}
} }
foreach (global::Google.Protobuf.TestProtos.ForeignMessage element in repeatedForeignMessage_) { if (repeatedForeignMessage_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(49, element); foreach (global::Google.Protobuf.TestProtos.ForeignMessage element in repeatedForeignMessage_) {
size += pb::CodedOutputStream.ComputeMessageSize(49, element);
}
} }
foreach (global::Google.Protobuf.TestProtos.ImportMessage element in repeatedImportMessage_) { if (repeatedImportMessage_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(50, element); foreach (global::Google.Protobuf.TestProtos.ImportMessage element in repeatedImportMessage_) {
size += pb::CodedOutputStream.ComputeMessageSize(50, element);
}
} }
{ if (repeatedNestedEnum_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (repeatedNestedEnum_.Count > 0) { foreach (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) {
foreach (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum element in repeatedNestedEnum_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
{ if (repeatedForeignEnum_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (repeatedForeignEnum_.Count > 0) { foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in repeatedForeignEnum_) {
foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in repeatedForeignEnum_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
{ if (repeatedImportEnum_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (repeatedImportEnum_.Count > 0) { foreach (global::Google.Protobuf.TestProtos.ImportEnum element in repeatedImportEnum_) {
foreach (global::Google.Protobuf.TestProtos.ImportEnum element in repeatedImportEnum_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
foreach (global::Google.Protobuf.TestProtos.PublicImportMessage element in repeatedPublicImportMessage_) { if (repeatedPublicImportMessage_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(54, element); foreach (global::Google.Protobuf.TestProtos.PublicImportMessage element in repeatedPublicImportMessage_) {
size += pb::CodedOutputStream.ComputeMessageSize(54, element);
}
} }
if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) { if (oneofFieldCase_ == OneofFieldOneofCase.OneofUint32) {
size += pb::CodedOutputStream.ComputeUInt32Size(111, OneofUint32); size += pb::CodedOutputStream.ComputeUInt32Size(111, OneofUint32);
...@@ -1293,10 +1313,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1293,10 +1313,10 @@ namespace Google.Protobuf.TestProtos {
if (other.SingleBool != false) { if (other.SingleBool != false) {
SingleBool = other.SingleBool; SingleBool = other.SingleBool;
} }
if (other.SingleString != "") { if (other.SingleString.Length != 0) {
SingleString = other.SingleString; SingleString = other.SingleString;
} }
if (other.SingleBytes != pb::ByteString.Empty) { if (other.SingleBytes.Length != 0) {
SingleBytes = other.SingleBytes; SingleBytes = other.SingleBytes;
} }
if (other.singleNestedMessage_ != null) { if (other.singleNestedMessage_ != null) {
...@@ -1383,63 +1403,63 @@ namespace Google.Protobuf.TestProtos { ...@@ -1383,63 +1403,63 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
singleInt32_ = input.ReadInt32(); SingleInt32 = input.ReadInt32();
break; break;
} }
case 16: { case 16: {
singleInt64_ = input.ReadInt64(); SingleInt64 = input.ReadInt64();
break; break;
} }
case 24: { case 24: {
singleUint32_ = input.ReadUInt32(); SingleUint32 = input.ReadUInt32();
break; break;
} }
case 32: { case 32: {
singleUint64_ = input.ReadUInt64(); SingleUint64 = input.ReadUInt64();
break; break;
} }
case 40: { case 40: {
singleSint32_ = input.ReadSInt32(); SingleSint32 = input.ReadSInt32();
break; break;
} }
case 48: { case 48: {
singleSint64_ = input.ReadSInt64(); SingleSint64 = input.ReadSInt64();
break; break;
} }
case 61: { case 61: {
singleFixed32_ = input.ReadFixed32(); SingleFixed32 = input.ReadFixed32();
break; break;
} }
case 65: { case 65: {
singleFixed64_ = input.ReadFixed64(); SingleFixed64 = input.ReadFixed64();
break; break;
} }
case 77: { case 77: {
singleSfixed32_ = input.ReadSFixed32(); SingleSfixed32 = input.ReadSFixed32();
break; break;
} }
case 81: { case 81: {
singleSfixed64_ = input.ReadSFixed64(); SingleSfixed64 = input.ReadSFixed64();
break; break;
} }
case 93: { case 93: {
singleFloat_ = input.ReadFloat(); SingleFloat = input.ReadFloat();
break; break;
} }
case 97: { case 97: {
singleDouble_ = input.ReadDouble(); SingleDouble = input.ReadDouble();
break; break;
} }
case 104: { case 104: {
singleBool_ = input.ReadBool(); SingleBool = input.ReadBool();
break; break;
} }
case 114: { case 114: {
singleString_ = input.ReadString(); SingleString = input.ReadString();
break; break;
} }
case 122: { case 122: {
singleBytes_ = input.ReadBytes(); SingleBytes = input.ReadBytes();
break; break;
} }
case 146: { case 146: {
...@@ -1587,9 +1607,8 @@ namespace Google.Protobuf.TestProtos { ...@@ -1587,9 +1607,8 @@ namespace Google.Protobuf.TestProtos {
break; break;
} }
case 888: { case 888: {
oneofField_ = input.ReadUInt32() OneofUint32 = input.ReadUInt32()
;oneofFieldCase_ = OneofFieldOneofCase.OneofUint32; ;break;
break;
} }
case 898: { case 898: {
global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage(); global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage();
...@@ -1601,14 +1620,12 @@ namespace Google.Protobuf.TestProtos { ...@@ -1601,14 +1620,12 @@ namespace Google.Protobuf.TestProtos {
break; break;
} }
case 906: { case 906: {
oneofField_ = input.ReadString() OneofString = input.ReadString()
;oneofFieldCase_ = OneofFieldOneofCase.OneofString; ;break;
break;
} }
case 914: { case 914: {
oneofField_ = input.ReadBytes() OneofBytes = input.ReadBytes()
;oneofFieldCase_ = OneofFieldOneofCase.OneofBytes; ;break;
break;
} }
} }
} }
...@@ -1707,7 +1724,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -1707,7 +1724,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
bb_ = input.ReadInt32(); Bb = input.ReadInt32();
break; break;
} }
} }
...@@ -1790,7 +1807,9 @@ namespace Google.Protobuf.TestProtos { ...@@ -1790,7 +1807,9 @@ namespace Google.Protobuf.TestProtos {
if (payload_ != null) { if (payload_ != null) {
output.WriteMessage(2, Payload); output.WriteMessage(2, Payload);
} }
output.WriteMessageArray(3, repeatedChild_); if (repeatedChild_.Count > 0) {
output.WriteMessageArray(3, repeatedChild_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -1801,8 +1820,10 @@ namespace Google.Protobuf.TestProtos { ...@@ -1801,8 +1820,10 @@ namespace Google.Protobuf.TestProtos {
if (payload_ != null) { if (payload_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(2, Payload); size += pb::CodedOutputStream.ComputeMessageSize(2, Payload);
} }
foreach (global::Google.Protobuf.TestProtos.NestedTestAllTypes element in repeatedChild_) { if (repeatedChild_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(3, element); foreach (global::Google.Protobuf.TestProtos.NestedTestAllTypes element in repeatedChild_) {
size += pb::CodedOutputStream.ComputeMessageSize(3, element);
}
} }
return size; return size;
} }
...@@ -1943,7 +1964,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -1943,7 +1964,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
deprecatedInt32_ = input.ReadInt32(); DeprecatedInt32 = input.ReadInt32();
break; break;
} }
} }
...@@ -2034,7 +2055,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2034,7 +2055,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
c_ = input.ReadInt32(); C = input.ReadInt32();
break; break;
} }
} }
...@@ -2307,11 +2328,11 @@ namespace Google.Protobuf.TestProtos { ...@@ -2307,11 +2328,11 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
a_ = input.ReadInt32(); A = input.ReadInt32();
break; break;
} }
case 2147483640: { case 2147483640: {
bb_ = input.ReadInt32(); Bb = input.ReadInt32();
break; break;
} }
} }
...@@ -2429,7 +2450,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2429,7 +2450,7 @@ namespace Google.Protobuf.TestProtos {
break; break;
} }
case 16: { case 16: {
i_ = input.ReadInt32(); I = input.ReadInt32();
break; break;
} }
} }
...@@ -2642,7 +2663,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2642,7 +2663,7 @@ namespace Google.Protobuf.TestProtos {
break; break;
} }
case 16: { case 16: {
optionalInt32_ = input.ReadInt32(); OptionalInt32 = input.ReadInt32();
break; break;
} }
} }
...@@ -2749,7 +2770,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2749,7 +2770,7 @@ namespace Google.Protobuf.TestProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (PrimitiveField != 0) hash ^= PrimitiveField.GetHashCode(); if (PrimitiveField != 0) hash ^= PrimitiveField.GetHashCode();
if (StringField != "") hash ^= StringField.GetHashCode(); if (StringField.Length != 0) hash ^= StringField.GetHashCode();
if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) hash ^= EnumField.GetHashCode(); if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) hash ^= EnumField.GetHashCode();
if (messageField_ != null) hash ^= MessageField.GetHashCode(); if (messageField_ != null) hash ^= MessageField.GetHashCode();
hash ^= repeatedPrimitiveField_.GetHashCode(); hash ^= repeatedPrimitiveField_.GetHashCode();
...@@ -2763,7 +2784,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2763,7 +2784,7 @@ namespace Google.Protobuf.TestProtos {
if (PrimitiveField != 0) { if (PrimitiveField != 0) {
output.WriteInt32(1, PrimitiveField); output.WriteInt32(1, PrimitiveField);
} }
if (StringField != "") { if (StringField.Length != 0) {
output.WriteString(2, StringField); output.WriteString(2, StringField);
} }
if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) { if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) {
...@@ -2772,10 +2793,18 @@ namespace Google.Protobuf.TestProtos { ...@@ -2772,10 +2793,18 @@ namespace Google.Protobuf.TestProtos {
if (messageField_ != null) { if (messageField_ != null) {
output.WriteMessage(4, MessageField); output.WriteMessage(4, MessageField);
} }
output.WritePackedInt32Array(7, repeatedPrimitiveField_); if (repeatedPrimitiveField_.Count > 0) {
output.WriteStringArray(8, repeatedStringField_); output.WritePackedInt32Array(7, repeatedPrimitiveField_);
output.WritePackedEnumArray(9, repeatedEnumField_); }
output.WriteMessageArray(10, repeatedMessageField_); if (repeatedStringField_.Count > 0) {
output.WriteStringArray(8, repeatedStringField_);
}
if (repeatedEnumField_.Count > 0) {
output.WritePackedEnumArray(9, repeatedEnumField_);
}
if (repeatedMessageField_.Count > 0) {
output.WriteMessageArray(10, repeatedMessageField_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -2783,7 +2812,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2783,7 +2812,7 @@ namespace Google.Protobuf.TestProtos {
if (PrimitiveField != 0) { if (PrimitiveField != 0) {
size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveField); size += pb::CodedOutputStream.ComputeInt32Size(1, PrimitiveField);
} }
if (StringField != "") { if (StringField.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(2, StringField); size += pb::CodedOutputStream.ComputeStringSize(2, StringField);
} }
if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) { if (EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) {
...@@ -2792,17 +2821,15 @@ namespace Google.Protobuf.TestProtos { ...@@ -2792,17 +2821,15 @@ namespace Google.Protobuf.TestProtos {
if (messageField_ != null) { if (messageField_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(4, MessageField); size += pb::CodedOutputStream.ComputeMessageSize(4, MessageField);
} }
{ if (repeatedPrimitiveField_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in repeatedPrimitiveField_) { foreach (int element in repeatedPrimitiveField_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedPrimitiveField_.Count != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedStringField_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (string element in repeatedStringField_) { foreach (string element in repeatedStringField_) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
...@@ -2810,19 +2837,19 @@ namespace Google.Protobuf.TestProtos { ...@@ -2810,19 +2837,19 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 1 * repeatedStringField_.Count; size += 1 * repeatedStringField_.Count;
} }
{ if (repeatedEnumField_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (repeatedEnumField_.Count > 0) { foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in repeatedEnumField_) {
foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in repeatedEnumField_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 1;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
size += dataSize;
size += 1;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
foreach (global::Google.Protobuf.TestProtos.ForeignMessage element in repeatedMessageField_) { if (repeatedMessageField_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(10, element); foreach (global::Google.Protobuf.TestProtos.ForeignMessage element in repeatedMessageField_) {
size += pb::CodedOutputStream.ComputeMessageSize(10, element);
}
} }
return size; return size;
} }
...@@ -2833,7 +2860,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2833,7 +2860,7 @@ namespace Google.Protobuf.TestProtos {
if (other.PrimitiveField != 0) { if (other.PrimitiveField != 0) {
PrimitiveField = other.PrimitiveField; PrimitiveField = other.PrimitiveField;
} }
if (other.StringField != "") { if (other.StringField.Length != 0) {
StringField = other.StringField; StringField = other.StringField;
} }
if (other.EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) { if (other.EnumField != global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED) {
...@@ -2863,11 +2890,11 @@ namespace Google.Protobuf.TestProtos { ...@@ -2863,11 +2890,11 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
primitiveField_ = input.ReadInt32(); PrimitiveField = input.ReadInt32();
break; break;
} }
case 18: { case 18: {
stringField_ = input.ReadString(); StringField = input.ReadString();
break; break;
} }
case 24: { case 24: {
...@@ -2974,7 +3001,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2974,7 +3001,7 @@ namespace Google.Protobuf.TestProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (MyString != "") hash ^= MyString.GetHashCode(); if (MyString.Length != 0) hash ^= MyString.GetHashCode();
if (MyInt != 0L) hash ^= MyInt.GetHashCode(); if (MyInt != 0L) hash ^= MyInt.GetHashCode();
if (MyFloat != 0F) hash ^= MyFloat.GetHashCode(); if (MyFloat != 0F) hash ^= MyFloat.GetHashCode();
if (singleNestedMessage_ != null) hash ^= SingleNestedMessage.GetHashCode(); if (singleNestedMessage_ != null) hash ^= SingleNestedMessage.GetHashCode();
...@@ -2985,7 +3012,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2985,7 +3012,7 @@ namespace Google.Protobuf.TestProtos {
if (MyInt != 0L) { if (MyInt != 0L) {
output.WriteInt64(1, MyInt); output.WriteInt64(1, MyInt);
} }
if (MyString != "") { if (MyString.Length != 0) {
output.WriteString(11, MyString); output.WriteString(11, MyString);
} }
if (MyFloat != 0F) { if (MyFloat != 0F) {
...@@ -2998,7 +3025,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -2998,7 +3025,7 @@ namespace Google.Protobuf.TestProtos {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (MyString != "") { if (MyString.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(11, MyString); size += pb::CodedOutputStream.ComputeStringSize(11, MyString);
} }
if (MyInt != 0L) { if (MyInt != 0L) {
...@@ -3016,7 +3043,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3016,7 +3043,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.MyString != "") { if (other.MyString.Length != 0) {
MyString = other.MyString; MyString = other.MyString;
} }
if (other.MyInt != 0L) { if (other.MyInt != 0L) {
...@@ -3045,15 +3072,15 @@ namespace Google.Protobuf.TestProtos { ...@@ -3045,15 +3072,15 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
myInt_ = input.ReadInt64(); MyInt = input.ReadInt64();
break; break;
} }
case 90: { case 90: {
myString_ = input.ReadString(); MyString = input.ReadString();
break; break;
} }
case 813: { case 813: {
myFloat_ = input.ReadFloat(); MyFloat = input.ReadFloat();
break; break;
} }
case 1602: { case 1602: {
...@@ -3171,11 +3198,11 @@ namespace Google.Protobuf.TestProtos { ...@@ -3171,11 +3198,11 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
bb_ = input.ReadInt32(); Bb = input.ReadInt32();
break; break;
} }
case 16: { case 16: {
oo_ = input.ReadInt64(); Oo = input.ReadInt64();
break; break;
} }
} }
...@@ -3324,19 +3351,19 @@ namespace Google.Protobuf.TestProtos { ...@@ -3324,19 +3351,19 @@ namespace Google.Protobuf.TestProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Data != "") hash ^= Data.GetHashCode(); if (Data.Length != 0) hash ^= Data.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != "") { if (Data.Length != 0) {
output.WriteString(1, Data); output.WriteString(1, Data);
} }
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Data != "") { if (Data.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Data); size += pb::CodedOutputStream.ComputeStringSize(1, Data);
} }
return size; return size;
...@@ -3345,7 +3372,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3345,7 +3372,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Data != "") { if (other.Data.Length != 0) {
Data = other.Data; Data = other.Data;
} }
} }
...@@ -3362,7 +3389,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3362,7 +3389,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 10: { case 10: {
data_ = input.ReadString(); Data = input.ReadString();
break; break;
} }
} }
...@@ -3418,12 +3445,14 @@ namespace Google.Protobuf.TestProtos { ...@@ -3418,12 +3445,14 @@ namespace Google.Protobuf.TestProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WriteStringArray(1, data_); if (data_.Count > 0) {
output.WriteStringArray(1, data_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
{ if (data_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (string element in data_) { foreach (string element in data_) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
...@@ -3505,19 +3534,19 @@ namespace Google.Protobuf.TestProtos { ...@@ -3505,19 +3534,19 @@ namespace Google.Protobuf.TestProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Data != pb::ByteString.Empty) hash ^= Data.GetHashCode(); if (Data.Length != 0) hash ^= Data.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != pb::ByteString.Empty) { if (Data.Length != 0) {
output.WriteBytes(1, Data); output.WriteBytes(1, Data);
} }
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Data != pb::ByteString.Empty) { if (Data.Length != 0) {
size += pb::CodedOutputStream.ComputeBytesSize(1, Data); size += pb::CodedOutputStream.ComputeBytesSize(1, Data);
} }
return size; return size;
...@@ -3526,7 +3555,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3526,7 +3555,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Data != pb::ByteString.Empty) { if (other.Data.Length != 0) {
Data = other.Data; Data = other.Data;
} }
} }
...@@ -3543,7 +3572,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3543,7 +3572,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 10: { case 10: {
data_ = input.ReadBytes(); Data = input.ReadBytes();
break; break;
} }
} }
...@@ -3596,19 +3625,19 @@ namespace Google.Protobuf.TestProtos { ...@@ -3596,19 +3625,19 @@ namespace Google.Protobuf.TestProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Data != pb::ByteString.Empty) hash ^= Data.GetHashCode(); if (Data.Length != 0) hash ^= Data.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Data != pb::ByteString.Empty) { if (Data.Length != 0) {
output.WriteBytes(1, Data); output.WriteBytes(1, Data);
} }
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Data != pb::ByteString.Empty) { if (Data.Length != 0) {
size += pb::CodedOutputStream.ComputeBytesSize(1, Data); size += pb::CodedOutputStream.ComputeBytesSize(1, Data);
} }
return size; return size;
...@@ -3617,7 +3646,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3617,7 +3646,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Data != pb::ByteString.Empty) { if (other.Data.Length != 0) {
Data = other.Data; Data = other.Data;
} }
} }
...@@ -3634,7 +3663,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3634,7 +3663,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 10: { case 10: {
data_ = input.ReadBytes(); Data = input.ReadBytes();
break; break;
} }
} }
...@@ -3725,7 +3754,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3725,7 +3754,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
data_ = input.ReadInt32(); Data = input.ReadInt32();
break; break;
} }
} }
...@@ -3816,7 +3845,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3816,7 +3845,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
data_ = input.ReadUInt32(); Data = input.ReadUInt32();
break; break;
} }
} }
...@@ -3907,7 +3936,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3907,7 +3936,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
data_ = input.ReadInt64(); Data = input.ReadInt64();
break; break;
} }
} }
...@@ -3998,7 +4027,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -3998,7 +4027,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
data_ = input.ReadUInt64(); Data = input.ReadUInt64();
break; break;
} }
} }
...@@ -4089,7 +4118,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -4089,7 +4118,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
data_ = input.ReadBool(); Data = input.ReadBool();
break; break;
} }
} }
...@@ -4131,7 +4160,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -4131,7 +4160,7 @@ namespace Google.Protobuf.TestProtos {
get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; } get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; }
set { set {
foo_ = value ?? ""; foo_ = value ?? "";
fooCase_ = value == null ? FooOneofCase.None : FooOneofCase.FooString; fooCase_ = FooOneofCase.FooString;
} }
} }
...@@ -4240,14 +4269,12 @@ namespace Google.Protobuf.TestProtos { ...@@ -4240,14 +4269,12 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 8: { case 8: {
foo_ = input.ReadInt32() FooInt = input.ReadInt32()
;fooCase_ = FooOneofCase.FooInt; ;break;
break;
} }
case 18: { case 18: {
foo_ = input.ReadString() FooString = input.ReadString()
;fooCase_ = FooOneofCase.FooString; ;break;
break;
} }
case 26: { case 26: {
global::Google.Protobuf.TestProtos.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes(); global::Google.Protobuf.TestProtos.TestAllTypes subBuilder = new global::Google.Protobuf.TestProtos.TestAllTypes();
...@@ -4415,150 +4442,150 @@ namespace Google.Protobuf.TestProtos { ...@@ -4415,150 +4442,150 @@ namespace Google.Protobuf.TestProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WritePackedInt32Array(90, packedInt32_); if (packedInt32_.Count > 0) {
output.WritePackedInt64Array(91, packedInt64_); output.WritePackedInt32Array(90, packedInt32_);
output.WritePackedUInt32Array(92, packedUint32_); }
output.WritePackedUInt64Array(93, packedUint64_); if (packedInt64_.Count > 0) {
output.WritePackedSInt32Array(94, packedSint32_); output.WritePackedInt64Array(91, packedInt64_);
output.WritePackedSInt64Array(95, packedSint64_); }
output.WritePackedFixed32Array(96, packedFixed32_); if (packedUint32_.Count > 0) {
output.WritePackedFixed64Array(97, packedFixed64_); output.WritePackedUInt32Array(92, packedUint32_);
output.WritePackedSFixed32Array(98, packedSfixed32_); }
output.WritePackedSFixed64Array(99, packedSfixed64_); if (packedUint64_.Count > 0) {
output.WritePackedFloatArray(100, packedFloat_); output.WritePackedUInt64Array(93, packedUint64_);
output.WritePackedDoubleArray(101, packedDouble_); }
output.WritePackedBoolArray(102, packedBool_); if (packedSint32_.Count > 0) {
output.WritePackedEnumArray(103, packedEnum_); output.WritePackedSInt32Array(94, packedSint32_);
}
if (packedSint64_.Count > 0) {
output.WritePackedSInt64Array(95, packedSint64_);
}
if (packedFixed32_.Count > 0) {
output.WritePackedFixed32Array(96, packedFixed32_);
}
if (packedFixed64_.Count > 0) {
output.WritePackedFixed64Array(97, packedFixed64_);
}
if (packedSfixed32_.Count > 0) {
output.WritePackedSFixed32Array(98, packedSfixed32_);
}
if (packedSfixed64_.Count > 0) {
output.WritePackedSFixed64Array(99, packedSfixed64_);
}
if (packedFloat_.Count > 0) {
output.WritePackedFloatArray(100, packedFloat_);
}
if (packedDouble_.Count > 0) {
output.WritePackedDoubleArray(101, packedDouble_);
}
if (packedBool_.Count > 0) {
output.WritePackedBoolArray(102, packedBool_);
}
if (packedEnum_.Count > 0) {
output.WritePackedEnumArray(103, packedEnum_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
{ if (packedInt32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in packedInt32_) { foreach (int element in packedInt32_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (packedInt32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedInt64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (long element in packedInt64_) { foreach (long element in packedInt64_) {
dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (packedInt64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedUint32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (uint element in packedUint32_) { foreach (uint element in packedUint32_) {
dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (packedUint32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedUint64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (ulong element in packedUint64_) { foreach (ulong element in packedUint64_) {
dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (packedUint64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedSint32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in packedSint32_) { foreach (int element in packedSint32_) {
dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (packedSint32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedSint64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (long element in packedSint64_) { foreach (long element in packedSint64_) {
dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (packedSint64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedFixed32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * packedFixed32_.Count; dataSize = 4 * packedFixed32_.Count;
size += dataSize; size += dataSize;
if (packedFixed32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedFixed64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * packedFixed64_.Count; dataSize = 8 * packedFixed64_.Count;
size += dataSize; size += dataSize;
if (packedFixed64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedSfixed32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * packedSfixed32_.Count; dataSize = 4 * packedSfixed32_.Count;
size += dataSize; size += dataSize;
if (packedSfixed32_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedSfixed64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * packedSfixed64_.Count; dataSize = 8 * packedSfixed64_.Count;
size += dataSize; size += dataSize;
if (packedSfixed64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedFloat_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * packedFloat_.Count; dataSize = 4 * packedFloat_.Count;
size += dataSize; size += dataSize;
if (packedFloat_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedDouble_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * packedDouble_.Count; dataSize = 8 * packedDouble_.Count;
size += dataSize; size += dataSize;
if (packedDouble_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedBool_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 1 * packedBool_.Count; dataSize = 1 * packedBool_.Count;
size += dataSize; size += dataSize;
if (packedBool_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (packedEnum_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (packedEnum_.Count > 0) { foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in packedEnum_) {
foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in packedEnum_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
size += dataSize;
size += 2;
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
} }
return size; return size;
} }
...@@ -4820,25 +4847,53 @@ namespace Google.Protobuf.TestProtos { ...@@ -4820,25 +4847,53 @@ namespace Google.Protobuf.TestProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WriteInt32Array(90, unpackedInt32_); if (unpackedInt32_.Count > 0) {
output.WriteInt64Array(91, unpackedInt64_); output.WriteInt32Array(90, unpackedInt32_);
output.WriteUInt32Array(92, unpackedUint32_); }
output.WriteUInt64Array(93, unpackedUint64_); if (unpackedInt64_.Count > 0) {
output.WriteSInt32Array(94, unpackedSint32_); output.WriteInt64Array(91, unpackedInt64_);
output.WriteSInt64Array(95, unpackedSint64_); }
output.WriteFixed32Array(96, unpackedFixed32_); if (unpackedUint32_.Count > 0) {
output.WriteFixed64Array(97, unpackedFixed64_); output.WriteUInt32Array(92, unpackedUint32_);
output.WriteSFixed32Array(98, unpackedSfixed32_); }
output.WriteSFixed64Array(99, unpackedSfixed64_); if (unpackedUint64_.Count > 0) {
output.WriteFloatArray(100, unpackedFloat_); output.WriteUInt64Array(93, unpackedUint64_);
output.WriteDoubleArray(101, unpackedDouble_); }
output.WriteBoolArray(102, unpackedBool_); if (unpackedSint32_.Count > 0) {
output.WriteEnumArray(103, unpackedEnum_); output.WriteSInt32Array(94, unpackedSint32_);
}
if (unpackedSint64_.Count > 0) {
output.WriteSInt64Array(95, unpackedSint64_);
}
if (unpackedFixed32_.Count > 0) {
output.WriteFixed32Array(96, unpackedFixed32_);
}
if (unpackedFixed64_.Count > 0) {
output.WriteFixed64Array(97, unpackedFixed64_);
}
if (unpackedSfixed32_.Count > 0) {
output.WriteSFixed32Array(98, unpackedSfixed32_);
}
if (unpackedSfixed64_.Count > 0) {
output.WriteSFixed64Array(99, unpackedSfixed64_);
}
if (unpackedFloat_.Count > 0) {
output.WriteFloatArray(100, unpackedFloat_);
}
if (unpackedDouble_.Count > 0) {
output.WriteDoubleArray(101, unpackedDouble_);
}
if (unpackedBool_.Count > 0) {
output.WriteBoolArray(102, unpackedBool_);
}
if (unpackedEnum_.Count > 0) {
output.WriteEnumArray(103, unpackedEnum_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
{ if (unpackedInt32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in unpackedInt32_) { foreach (int element in unpackedInt32_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
...@@ -4846,7 +4901,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -4846,7 +4901,7 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * unpackedInt32_.Count; size += 2 * unpackedInt32_.Count;
} }
{ if (unpackedInt64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (long element in unpackedInt64_) { foreach (long element in unpackedInt64_) {
dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element);
...@@ -4854,7 +4909,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -4854,7 +4909,7 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * unpackedInt64_.Count; size += 2 * unpackedInt64_.Count;
} }
{ if (unpackedUint32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (uint element in unpackedUint32_) { foreach (uint element in unpackedUint32_) {
dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element);
...@@ -4862,7 +4917,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -4862,7 +4917,7 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * unpackedUint32_.Count; size += 2 * unpackedUint32_.Count;
} }
{ if (unpackedUint64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (ulong element in unpackedUint64_) { foreach (ulong element in unpackedUint64_) {
dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element);
...@@ -4870,7 +4925,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -4870,7 +4925,7 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * unpackedUint64_.Count; size += 2 * unpackedUint64_.Count;
} }
{ if (unpackedSint32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in unpackedSint32_) { foreach (int element in unpackedSint32_) {
dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element);
...@@ -4878,7 +4933,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -4878,7 +4933,7 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * unpackedSint32_.Count; size += 2 * unpackedSint32_.Count;
} }
{ if (unpackedSint64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (long element in unpackedSint64_) { foreach (long element in unpackedSint64_) {
dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element);
...@@ -4886,57 +4941,55 @@ namespace Google.Protobuf.TestProtos { ...@@ -4886,57 +4941,55 @@ namespace Google.Protobuf.TestProtos {
size += dataSize; size += dataSize;
size += 2 * unpackedSint64_.Count; size += 2 * unpackedSint64_.Count;
} }
{ if (unpackedFixed32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * unpackedFixed32_.Count; dataSize = 4 * unpackedFixed32_.Count;
size += dataSize; size += dataSize;
size += 2 * unpackedFixed32_.Count; size += 2 * unpackedFixed32_.Count;
} }
{ if (unpackedFixed64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * unpackedFixed64_.Count; dataSize = 8 * unpackedFixed64_.Count;
size += dataSize; size += dataSize;
size += 2 * unpackedFixed64_.Count; size += 2 * unpackedFixed64_.Count;
} }
{ if (unpackedSfixed32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * unpackedSfixed32_.Count; dataSize = 4 * unpackedSfixed32_.Count;
size += dataSize; size += dataSize;
size += 2 * unpackedSfixed32_.Count; size += 2 * unpackedSfixed32_.Count;
} }
{ if (unpackedSfixed64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * unpackedSfixed64_.Count; dataSize = 8 * unpackedSfixed64_.Count;
size += dataSize; size += dataSize;
size += 2 * unpackedSfixed64_.Count; size += 2 * unpackedSfixed64_.Count;
} }
{ if (unpackedFloat_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * unpackedFloat_.Count; dataSize = 4 * unpackedFloat_.Count;
size += dataSize; size += dataSize;
size += 2 * unpackedFloat_.Count; size += 2 * unpackedFloat_.Count;
} }
{ if (unpackedDouble_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * unpackedDouble_.Count; dataSize = 8 * unpackedDouble_.Count;
size += dataSize; size += dataSize;
size += 2 * unpackedDouble_.Count; size += 2 * unpackedDouble_.Count;
} }
{ if (unpackedBool_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 1 * unpackedBool_.Count; dataSize = 1 * unpackedBool_.Count;
size += dataSize; size += dataSize;
size += 2 * unpackedBool_.Count; size += 2 * unpackedBool_.Count;
} }
{ if (unpackedEnum_.Count > 0) {
int dataSize = 0; int dataSize = 0;
if (unpackedEnum_.Count > 0) { foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in unpackedEnum_) {
foreach (global::Google.Protobuf.TestProtos.ForeignEnum element in unpackedEnum_) { dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 2 * unpackedEnum_.Count;
} }
size += dataSize;
size += 2 * unpackedEnum_.Count;
} }
return size; return size;
} }
...@@ -5134,69 +5187,69 @@ namespace Google.Protobuf.TestProtos { ...@@ -5134,69 +5187,69 @@ namespace Google.Protobuf.TestProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WritePackedFixed32Array(12, repeatedFixed32_); if (repeatedFixed32_.Count > 0) {
output.WritePackedInt32Array(13, repeatedInt32_); output.WritePackedFixed32Array(12, repeatedFixed32_);
output.WritePackedFixed64Array(2046, repeatedFixed64_); }
output.WritePackedInt64Array(2047, repeatedInt64_); if (repeatedInt32_.Count > 0) {
output.WritePackedFloatArray(262142, repeatedFloat_); output.WritePackedInt32Array(13, repeatedInt32_);
output.WritePackedUInt64Array(262143, repeatedUint64_); }
if (repeatedFixed64_.Count > 0) {
output.WritePackedFixed64Array(2046, repeatedFixed64_);
}
if (repeatedInt64_.Count > 0) {
output.WritePackedInt64Array(2047, repeatedInt64_);
}
if (repeatedFloat_.Count > 0) {
output.WritePackedFloatArray(262142, repeatedFloat_);
}
if (repeatedUint64_.Count > 0) {
output.WritePackedUInt64Array(262143, repeatedUint64_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
{ if (repeatedFixed32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * repeatedFixed32_.Count; dataSize = 4 * repeatedFixed32_.Count;
size += dataSize; size += dataSize;
if (repeatedFixed32_.Count != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedInt32_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in repeatedInt32_) { foreach (int element in repeatedInt32_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedInt32_.Count != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedFixed64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 8 * repeatedFixed64_.Count; dataSize = 8 * repeatedFixed64_.Count;
size += dataSize; size += dataSize;
if (repeatedFixed64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedInt64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (long element in repeatedInt64_) { foreach (long element in repeatedInt64_) {
dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedInt64_.Count != 0) { size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedFloat_.Count > 0) {
int dataSize = 0; int dataSize = 0;
dataSize = 4 * repeatedFloat_.Count; dataSize = 4 * repeatedFloat_.Count;
size += dataSize; size += dataSize;
if (repeatedFloat_.Count != 0) { size += 3 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 3 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (repeatedUint64_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (ulong element in repeatedUint64_) { foreach (ulong element in repeatedUint64_) {
dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (repeatedUint64_.Count != 0) { size += 3 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 3 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
return size; return size;
} }
...@@ -5303,19 +5356,19 @@ namespace Google.Protobuf.TestProtos { ...@@ -5303,19 +5356,19 @@ namespace Google.Protobuf.TestProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (A != "") hash ^= A.GetHashCode(); if (A.Length != 0) hash ^= A.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (A != "") { if (A.Length != 0) {
output.WriteString(1, A); output.WriteString(1, A);
} }
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (A != "") { if (A.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, A); size += pb::CodedOutputStream.ComputeStringSize(1, A);
} }
return size; return size;
...@@ -5324,7 +5377,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -5324,7 +5377,7 @@ namespace Google.Protobuf.TestProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.A != "") { if (other.A.Length != 0) {
A = other.A; A = other.A;
} }
} }
...@@ -5341,7 +5394,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -5341,7 +5394,7 @@ namespace Google.Protobuf.TestProtos {
} }
break; break;
case 10: { case 10: {
a_ = input.ReadString(); A = input.ReadString();
break; break;
} }
} }
......
...@@ -324,13 +324,17 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -324,13 +324,17 @@ namespace Google.Protobuf.DescriptorProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WriteMessageArray(1, file_); if (file_.Count > 0) {
output.WriteMessageArray(1, file_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
foreach (global::Google.Protobuf.DescriptorProtos.FileDescriptorProto element in file_) { if (file_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element); foreach (global::Google.Protobuf.DescriptorProtos.FileDescriptorProto element in file_) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
} }
return size; return size;
} }
...@@ -487,8 +491,8 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -487,8 +491,8 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Package != "") hash ^= Package.GetHashCode(); if (Package.Length != 0) hash ^= Package.GetHashCode();
hash ^= dependency_.GetHashCode(); hash ^= dependency_.GetHashCode();
hash ^= publicDependency_.GetHashCode(); hash ^= publicDependency_.GetHashCode();
hash ^= weakDependency_.GetHashCode(); hash ^= weakDependency_.GetHashCode();
...@@ -498,44 +502,58 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -498,44 +502,58 @@ namespace Google.Protobuf.DescriptorProtos {
hash ^= extension_.GetHashCode(); hash ^= extension_.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode(); if (options_ != null) hash ^= Options.GetHashCode();
if (sourceCodeInfo_ != null) hash ^= SourceCodeInfo.GetHashCode(); if (sourceCodeInfo_ != null) hash ^= SourceCodeInfo.GetHashCode();
if (Syntax != "") hash ^= Syntax.GetHashCode(); if (Syntax.Length != 0) hash ^= Syntax.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
if (Package != "") { if (Package.Length != 0) {
output.WriteString(2, Package); output.WriteString(2, Package);
} }
output.WriteStringArray(3, dependency_); if (dependency_.Count > 0) {
output.WriteMessageArray(4, messageType_); output.WriteStringArray(3, dependency_);
output.WriteMessageArray(5, enumType_); }
output.WriteMessageArray(6, service_); if (messageType_.Count > 0) {
output.WriteMessageArray(7, extension_); output.WriteMessageArray(4, messageType_);
}
if (enumType_.Count > 0) {
output.WriteMessageArray(5, enumType_);
}
if (service_.Count > 0) {
output.WriteMessageArray(6, service_);
}
if (extension_.Count > 0) {
output.WriteMessageArray(7, extension_);
}
if (options_ != null) { if (options_ != null) {
output.WriteMessage(8, Options); output.WriteMessage(8, Options);
} }
if (sourceCodeInfo_ != null) { if (sourceCodeInfo_ != null) {
output.WriteMessage(9, SourceCodeInfo); output.WriteMessage(9, SourceCodeInfo);
} }
output.WriteInt32Array(10, publicDependency_); if (publicDependency_.Count > 0) {
output.WriteInt32Array(11, weakDependency_); output.WriteInt32Array(10, publicDependency_);
if (Syntax != "") { }
if (weakDependency_.Count > 0) {
output.WriteInt32Array(11, weakDependency_);
}
if (Syntax.Length != 0) {
output.WriteString(12, Syntax); output.WriteString(12, Syntax);
} }
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
if (Package != "") { if (Package.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(2, Package); size += pb::CodedOutputStream.ComputeStringSize(2, Package);
} }
{ if (dependency_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (string element in dependency_) { foreach (string element in dependency_) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
...@@ -543,7 +561,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -543,7 +561,7 @@ namespace Google.Protobuf.DescriptorProtos {
size += dataSize; size += dataSize;
size += 1 * dependency_.Count; size += 1 * dependency_.Count;
} }
{ if (publicDependency_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in publicDependency_) { foreach (int element in publicDependency_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
...@@ -551,7 +569,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -551,7 +569,7 @@ namespace Google.Protobuf.DescriptorProtos {
size += dataSize; size += dataSize;
size += 1 * publicDependency_.Count; size += 1 * publicDependency_.Count;
} }
{ if (weakDependency_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in weakDependency_) { foreach (int element in weakDependency_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
...@@ -559,17 +577,25 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -559,17 +577,25 @@ namespace Google.Protobuf.DescriptorProtos {
size += dataSize; size += dataSize;
size += 1 * weakDependency_.Count; size += 1 * weakDependency_.Count;
} }
foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto element in messageType_) { if (messageType_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element); foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto element in messageType_) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.EnumDescriptorProto element in enumType_) { if (enumType_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(5, element); foreach (global::Google.Protobuf.DescriptorProtos.EnumDescriptorProto element in enumType_) {
size += pb::CodedOutputStream.ComputeMessageSize(5, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.ServiceDescriptorProto element in service_) { if (service_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(6, element); foreach (global::Google.Protobuf.DescriptorProtos.ServiceDescriptorProto element in service_) {
size += pb::CodedOutputStream.ComputeMessageSize(6, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto element in extension_) { if (extension_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(7, element); foreach (global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto element in extension_) {
size += pb::CodedOutputStream.ComputeMessageSize(7, element);
}
} }
if (options_ != null) { if (options_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(8, Options); size += pb::CodedOutputStream.ComputeMessageSize(8, Options);
...@@ -577,7 +603,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -577,7 +603,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (sourceCodeInfo_ != null) { if (sourceCodeInfo_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(9, SourceCodeInfo); size += pb::CodedOutputStream.ComputeMessageSize(9, SourceCodeInfo);
} }
if (Syntax != "") { if (Syntax.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(12, Syntax); size += pb::CodedOutputStream.ComputeStringSize(12, Syntax);
} }
return size; return size;
...@@ -586,10 +612,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -586,10 +612,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
if (other.Package != "") { if (other.Package.Length != 0) {
Package = other.Package; Package = other.Package;
} }
dependency_.Add(other.dependency_); dependency_.Add(other.dependency_);
...@@ -611,7 +637,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -611,7 +637,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
SourceCodeInfo.MergeFrom(other.SourceCodeInfo); SourceCodeInfo.MergeFrom(other.SourceCodeInfo);
} }
if (other.Syntax != "") { if (other.Syntax.Length != 0) {
Syntax = other.Syntax; Syntax = other.Syntax;
} }
} }
...@@ -628,11 +654,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -628,11 +654,11 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 18: { case 18: {
package_ = input.ReadString(); Package = input.ReadString();
break; break;
} }
case 26: { case 26: {
...@@ -680,7 +706,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -680,7 +706,7 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 98: { case 98: {
syntax_ = input.ReadString(); Syntax = input.ReadString();
break; break;
} }
} }
...@@ -796,7 +822,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -796,7 +822,7 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= field_.GetHashCode(); hash ^= field_.GetHashCode();
hash ^= extension_.GetHashCode(); hash ^= extension_.GetHashCode();
hash ^= nestedType_.GetHashCode(); hash ^= nestedType_.GetHashCode();
...@@ -810,52 +836,82 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -810,52 +836,82 @@ namespace Google.Protobuf.DescriptorProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
output.WriteMessageArray(2, field_); if (field_.Count > 0) {
output.WriteMessageArray(3, nestedType_); output.WriteMessageArray(2, field_);
output.WriteMessageArray(4, enumType_); }
output.WriteMessageArray(5, extensionRange_); if (nestedType_.Count > 0) {
output.WriteMessageArray(6, extension_); output.WriteMessageArray(3, nestedType_);
}
if (enumType_.Count > 0) {
output.WriteMessageArray(4, enumType_);
}
if (extensionRange_.Count > 0) {
output.WriteMessageArray(5, extensionRange_);
}
if (extension_.Count > 0) {
output.WriteMessageArray(6, extension_);
}
if (options_ != null) { if (options_ != null) {
output.WriteMessage(7, Options); output.WriteMessage(7, Options);
} }
output.WriteMessageArray(8, oneofDecl_); if (oneofDecl_.Count > 0) {
output.WriteMessageArray(9, reservedRange_); output.WriteMessageArray(8, oneofDecl_);
output.WriteStringArray(10, reservedName_); }
if (reservedRange_.Count > 0) {
output.WriteMessageArray(9, reservedRange_);
}
if (reservedName_.Count > 0) {
output.WriteStringArray(10, reservedName_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
foreach (global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto element in field_) { if (field_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element); foreach (global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto element in field_) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto element in extension_) { if (extension_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(6, element); foreach (global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto element in extension_) {
size += pb::CodedOutputStream.ComputeMessageSize(6, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto element in nestedType_) { if (nestedType_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(3, element); foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto element in nestedType_) {
size += pb::CodedOutputStream.ComputeMessageSize(3, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.EnumDescriptorProto element in enumType_) { if (enumType_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element); foreach (global::Google.Protobuf.DescriptorProtos.EnumDescriptorProto element in enumType_) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ExtensionRange element in extensionRange_) { if (extensionRange_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(5, element); foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ExtensionRange element in extensionRange_) {
size += pb::CodedOutputStream.ComputeMessageSize(5, element);
}
} }
foreach (global::Google.Protobuf.DescriptorProtos.OneofDescriptorProto element in oneofDecl_) { if (oneofDecl_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(8, element); foreach (global::Google.Protobuf.DescriptorProtos.OneofDescriptorProto element in oneofDecl_) {
size += pb::CodedOutputStream.ComputeMessageSize(8, element);
}
} }
if (options_ != null) { if (options_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(7, Options); size += pb::CodedOutputStream.ComputeMessageSize(7, Options);
} }
foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ReservedRange element in reservedRange_) { if (reservedRange_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(9, element); foreach (global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ReservedRange element in reservedRange_) {
size += pb::CodedOutputStream.ComputeMessageSize(9, element);
}
} }
{ if (reservedName_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (string element in reservedName_) { foreach (string element in reservedName_) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
...@@ -869,7 +925,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -869,7 +925,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
field_.Add(other.field_); field_.Add(other.field_);
...@@ -900,7 +956,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -900,7 +956,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 18: { case 18: {
...@@ -1050,11 +1106,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1050,11 +1106,11 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 8: { case 8: {
start_ = input.ReadInt32(); Start = input.ReadInt32();
break; break;
} }
case 16: { case 16: {
end_ = input.ReadInt32(); End = input.ReadInt32();
break; break;
} }
} }
...@@ -1164,11 +1220,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1164,11 +1220,11 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 8: { case 8: {
start_ = input.ReadInt32(); Start = input.ReadInt32();
break; break;
} }
case 16: { case 16: {
end_ = input.ReadInt32(); End = input.ReadInt32();
break; break;
} }
} }
...@@ -1296,23 +1352,23 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1296,23 +1352,23 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Number != 0) hash ^= Number.GetHashCode(); if (Number != 0) hash ^= Number.GetHashCode();
if (Label != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL) hash ^= Label.GetHashCode(); if (Label != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL) hash ^= Label.GetHashCode();
if (Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) hash ^= Type.GetHashCode(); if (Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) hash ^= Type.GetHashCode();
if (TypeName != "") hash ^= TypeName.GetHashCode(); if (TypeName.Length != 0) hash ^= TypeName.GetHashCode();
if (Extendee != "") hash ^= Extendee.GetHashCode(); if (Extendee.Length != 0) hash ^= Extendee.GetHashCode();
if (DefaultValue != "") hash ^= DefaultValue.GetHashCode(); if (DefaultValue.Length != 0) hash ^= DefaultValue.GetHashCode();
if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode(); if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode(); if (options_ != null) hash ^= Options.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
if (Extendee != "") { if (Extendee.Length != 0) {
output.WriteString(2, Extendee); output.WriteString(2, Extendee);
} }
if (Number != 0) { if (Number != 0) {
...@@ -1324,10 +1380,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1324,10 +1380,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) { if (Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) {
output.WriteEnum(5, (int) Type); output.WriteEnum(5, (int) Type);
} }
if (TypeName != "") { if (TypeName.Length != 0) {
output.WriteString(6, TypeName); output.WriteString(6, TypeName);
} }
if (DefaultValue != "") { if (DefaultValue.Length != 0) {
output.WriteString(7, DefaultValue); output.WriteString(7, DefaultValue);
} }
if (options_ != null) { if (options_ != null) {
...@@ -1340,7 +1396,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1340,7 +1396,7 @@ namespace Google.Protobuf.DescriptorProtos {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
if (Number != 0) { if (Number != 0) {
...@@ -1352,13 +1408,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1352,13 +1408,13 @@ namespace Google.Protobuf.DescriptorProtos {
if (Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) { if (Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) {
size += pb::CodedOutputStream.ComputeEnumSize(5, (int) Type); size += pb::CodedOutputStream.ComputeEnumSize(5, (int) Type);
} }
if (TypeName != "") { if (TypeName.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(6, TypeName); size += pb::CodedOutputStream.ComputeStringSize(6, TypeName);
} }
if (Extendee != "") { if (Extendee.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(2, Extendee); size += pb::CodedOutputStream.ComputeStringSize(2, Extendee);
} }
if (DefaultValue != "") { if (DefaultValue.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(7, DefaultValue); size += pb::CodedOutputStream.ComputeStringSize(7, DefaultValue);
} }
if (OneofIndex != 0) { if (OneofIndex != 0) {
...@@ -1373,7 +1429,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1373,7 +1429,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
if (other.Number != 0) { if (other.Number != 0) {
...@@ -1385,13 +1441,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1385,13 +1441,13 @@ namespace Google.Protobuf.DescriptorProtos {
if (other.Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) { if (other.Type != global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE) {
Type = other.Type; Type = other.Type;
} }
if (other.TypeName != "") { if (other.TypeName.Length != 0) {
TypeName = other.TypeName; TypeName = other.TypeName;
} }
if (other.Extendee != "") { if (other.Extendee.Length != 0) {
Extendee = other.Extendee; Extendee = other.Extendee;
} }
if (other.DefaultValue != "") { if (other.DefaultValue.Length != 0) {
DefaultValue = other.DefaultValue; DefaultValue = other.DefaultValue;
} }
if (other.OneofIndex != 0) { if (other.OneofIndex != 0) {
...@@ -1417,15 +1473,15 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1417,15 +1473,15 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 18: { case 18: {
extendee_ = input.ReadString(); Extendee = input.ReadString();
break; break;
} }
case 24: { case 24: {
number_ = input.ReadInt32(); Number = input.ReadInt32();
break; break;
} }
case 32: { case 32: {
...@@ -1437,11 +1493,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1437,11 +1493,11 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 50: { case 50: {
typeName_ = input.ReadString(); TypeName = input.ReadString();
break; break;
} }
case 58: { case 58: {
defaultValue_ = input.ReadString(); DefaultValue = input.ReadString();
break; break;
} }
case 66: { case 66: {
...@@ -1452,7 +1508,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1452,7 +1508,7 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 72: { case 72: {
oneofIndex_ = input.ReadInt32(); OneofIndex = input.ReadInt32();
break; break;
} }
} }
...@@ -1538,19 +1594,19 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1538,19 +1594,19 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
return size; return size;
...@@ -1559,7 +1615,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1559,7 +1615,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
} }
...@@ -1576,7 +1632,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1576,7 +1632,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
} }
...@@ -1643,17 +1699,19 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1643,17 +1699,19 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= value_.GetHashCode(); hash ^= value_.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode(); if (options_ != null) hash ^= Options.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
output.WriteMessageArray(2, value_); if (value_.Count > 0) {
output.WriteMessageArray(2, value_);
}
if (options_ != null) { if (options_ != null) {
output.WriteMessage(3, Options); output.WriteMessage(3, Options);
} }
...@@ -1661,11 +1719,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1661,11 +1719,13 @@ namespace Google.Protobuf.DescriptorProtos {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
foreach (global::Google.Protobuf.DescriptorProtos.EnumValueDescriptorProto element in value_) { if (value_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element); foreach (global::Google.Protobuf.DescriptorProtos.EnumValueDescriptorProto element in value_) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
}
} }
if (options_ != null) { if (options_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(3, Options); size += pb::CodedOutputStream.ComputeMessageSize(3, Options);
...@@ -1676,7 +1736,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1676,7 +1736,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
value_.Add(other.value_); value_.Add(other.value_);
...@@ -1700,7 +1760,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1700,7 +1760,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 18: { case 18: {
...@@ -1780,14 +1840,14 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1780,14 +1840,14 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Number != 0) hash ^= Number.GetHashCode(); if (Number != 0) hash ^= Number.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode(); if (options_ != null) hash ^= Options.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
if (Number != 0) { if (Number != 0) {
...@@ -1800,7 +1860,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1800,7 +1860,7 @@ namespace Google.Protobuf.DescriptorProtos {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
if (Number != 0) { if (Number != 0) {
...@@ -1815,7 +1875,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1815,7 +1875,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
if (other.Number != 0) { if (other.Number != 0) {
...@@ -1841,11 +1901,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1841,11 +1901,11 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 16: { case 16: {
number_ = input.ReadInt32(); Number = input.ReadInt32();
break; break;
} }
case 26: { case 26: {
...@@ -1919,17 +1979,19 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1919,17 +1979,19 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= method_.GetHashCode(); hash ^= method_.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode(); if (options_ != null) hash ^= Options.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
output.WriteMessageArray(2, method_); if (method_.Count > 0) {
output.WriteMessageArray(2, method_);
}
if (options_ != null) { if (options_ != null) {
output.WriteMessage(3, Options); output.WriteMessage(3, Options);
} }
...@@ -1937,11 +1999,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1937,11 +1999,13 @@ namespace Google.Protobuf.DescriptorProtos {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
foreach (global::Google.Protobuf.DescriptorProtos.MethodDescriptorProto element in method_) { if (method_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element); foreach (global::Google.Protobuf.DescriptorProtos.MethodDescriptorProto element in method_) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
}
} }
if (options_ != null) { if (options_ != null) {
size += pb::CodedOutputStream.ComputeMessageSize(3, Options); size += pb::CodedOutputStream.ComputeMessageSize(3, Options);
...@@ -1952,7 +2016,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1952,7 +2016,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
method_.Add(other.method_); method_.Add(other.method_);
...@@ -1976,7 +2040,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -1976,7 +2040,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 18: { case 18: {
...@@ -2083,9 +2147,9 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2083,9 +2147,9 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (Name != "") hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
if (InputType != "") hash ^= InputType.GetHashCode(); if (InputType.Length != 0) hash ^= InputType.GetHashCode();
if (OutputType != "") hash ^= OutputType.GetHashCode(); if (OutputType.Length != 0) hash ^= OutputType.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode(); if (options_ != null) hash ^= Options.GetHashCode();
if (ClientStreaming != false) hash ^= ClientStreaming.GetHashCode(); if (ClientStreaming != false) hash ^= ClientStreaming.GetHashCode();
if (ServerStreaming != false) hash ^= ServerStreaming.GetHashCode(); if (ServerStreaming != false) hash ^= ServerStreaming.GetHashCode();
...@@ -2093,13 +2157,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2093,13 +2157,13 @@ namespace Google.Protobuf.DescriptorProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name != "") { if (Name.Length != 0) {
output.WriteString(1, Name); output.WriteString(1, Name);
} }
if (InputType != "") { if (InputType.Length != 0) {
output.WriteString(2, InputType); output.WriteString(2, InputType);
} }
if (OutputType != "") { if (OutputType.Length != 0) {
output.WriteString(3, OutputType); output.WriteString(3, OutputType);
} }
if (options_ != null) { if (options_ != null) {
...@@ -2115,13 +2179,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2115,13 +2179,13 @@ namespace Google.Protobuf.DescriptorProtos {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name != "") { if (Name.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name); size += pb::CodedOutputStream.ComputeStringSize(1, Name);
} }
if (InputType != "") { if (InputType.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(2, InputType); size += pb::CodedOutputStream.ComputeStringSize(2, InputType);
} }
if (OutputType != "") { if (OutputType.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(3, OutputType); size += pb::CodedOutputStream.ComputeStringSize(3, OutputType);
} }
if (options_ != null) { if (options_ != null) {
...@@ -2139,13 +2203,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2139,13 +2203,13 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.Name != "") { if (other.Name.Length != 0) {
Name = other.Name; Name = other.Name;
} }
if (other.InputType != "") { if (other.InputType.Length != 0) {
InputType = other.InputType; InputType = other.InputType;
} }
if (other.OutputType != "") { if (other.OutputType.Length != 0) {
OutputType = other.OutputType; OutputType = other.OutputType;
} }
if (other.options_ != null) { if (other.options_ != null) {
...@@ -2174,15 +2238,15 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2174,15 +2238,15 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
name_ = input.ReadString(); Name = input.ReadString();
break; break;
} }
case 18: { case 18: {
inputType_ = input.ReadString(); InputType = input.ReadString();
break; break;
} }
case 26: { case 26: {
outputType_ = input.ReadString(); OutputType = input.ReadString();
break; break;
} }
case 34: { case 34: {
...@@ -2193,11 +2257,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2193,11 +2257,11 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 40: { case 40: {
clientStreaming_ = input.ReadBool(); ClientStreaming = input.ReadBool();
break; break;
} }
case 48: { case 48: {
serverStreaming_ = input.ReadBool(); ServerStreaming = input.ReadBool();
break; break;
} }
} }
...@@ -2374,29 +2438,29 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2374,29 +2438,29 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (JavaPackage != "") hash ^= JavaPackage.GetHashCode(); if (JavaPackage.Length != 0) hash ^= JavaPackage.GetHashCode();
if (JavaOuterClassname != "") hash ^= JavaOuterClassname.GetHashCode(); if (JavaOuterClassname.Length != 0) hash ^= JavaOuterClassname.GetHashCode();
if (JavaMultipleFiles != false) hash ^= JavaMultipleFiles.GetHashCode(); if (JavaMultipleFiles != false) hash ^= JavaMultipleFiles.GetHashCode();
if (JavaGenerateEqualsAndHash != false) hash ^= JavaGenerateEqualsAndHash.GetHashCode(); if (JavaGenerateEqualsAndHash != false) hash ^= JavaGenerateEqualsAndHash.GetHashCode();
if (JavaStringCheckUtf8 != false) hash ^= JavaStringCheckUtf8.GetHashCode(); if (JavaStringCheckUtf8 != false) hash ^= JavaStringCheckUtf8.GetHashCode();
if (OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) hash ^= OptimizeFor.GetHashCode(); if (OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) hash ^= OptimizeFor.GetHashCode();
if (GoPackage != "") hash ^= GoPackage.GetHashCode(); if (GoPackage.Length != 0) hash ^= GoPackage.GetHashCode();
if (CcGenericServices != false) hash ^= CcGenericServices.GetHashCode(); if (CcGenericServices != false) hash ^= CcGenericServices.GetHashCode();
if (JavaGenericServices != false) hash ^= JavaGenericServices.GetHashCode(); if (JavaGenericServices != false) hash ^= JavaGenericServices.GetHashCode();
if (PyGenericServices != false) hash ^= PyGenericServices.GetHashCode(); if (PyGenericServices != false) hash ^= PyGenericServices.GetHashCode();
if (Deprecated != false) hash ^= Deprecated.GetHashCode(); if (Deprecated != false) hash ^= Deprecated.GetHashCode();
if (CcEnableArenas != false) hash ^= CcEnableArenas.GetHashCode(); if (CcEnableArenas != false) hash ^= CcEnableArenas.GetHashCode();
if (ObjcClassPrefix != "") hash ^= ObjcClassPrefix.GetHashCode(); if (ObjcClassPrefix.Length != 0) hash ^= ObjcClassPrefix.GetHashCode();
if (CsharpNamespace != "") hash ^= CsharpNamespace.GetHashCode(); if (CsharpNamespace.Length != 0) hash ^= CsharpNamespace.GetHashCode();
hash ^= uninterpretedOption_.GetHashCode(); hash ^= uninterpretedOption_.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (JavaPackage != "") { if (JavaPackage.Length != 0) {
output.WriteString(1, JavaPackage); output.WriteString(1, JavaPackage);
} }
if (JavaOuterClassname != "") { if (JavaOuterClassname.Length != 0) {
output.WriteString(8, JavaOuterClassname); output.WriteString(8, JavaOuterClassname);
} }
if (OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) { if (OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) {
...@@ -2405,7 +2469,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2405,7 +2469,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (JavaMultipleFiles != false) { if (JavaMultipleFiles != false) {
output.WriteBool(10, JavaMultipleFiles); output.WriteBool(10, JavaMultipleFiles);
} }
if (GoPackage != "") { if (GoPackage.Length != 0) {
output.WriteString(11, GoPackage); output.WriteString(11, GoPackage);
} }
if (CcGenericServices != false) { if (CcGenericServices != false) {
...@@ -2429,21 +2493,23 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2429,21 +2493,23 @@ namespace Google.Protobuf.DescriptorProtos {
if (CcEnableArenas != false) { if (CcEnableArenas != false) {
output.WriteBool(31, CcEnableArenas); output.WriteBool(31, CcEnableArenas);
} }
if (ObjcClassPrefix != "") { if (ObjcClassPrefix.Length != 0) {
output.WriteString(36, ObjcClassPrefix); output.WriteString(36, ObjcClassPrefix);
} }
if (CsharpNamespace != "") { if (CsharpNamespace.Length != 0) {
output.WriteString(37, CsharpNamespace); output.WriteString(37, CsharpNamespace);
} }
output.WriteMessageArray(999, uninterpretedOption_); if (uninterpretedOption_.Count > 0) {
output.WriteMessageArray(999, uninterpretedOption_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (JavaPackage != "") { if (JavaPackage.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, JavaPackage); size += pb::CodedOutputStream.ComputeStringSize(1, JavaPackage);
} }
if (JavaOuterClassname != "") { if (JavaOuterClassname.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(8, JavaOuterClassname); size += pb::CodedOutputStream.ComputeStringSize(8, JavaOuterClassname);
} }
if (JavaMultipleFiles != false) { if (JavaMultipleFiles != false) {
...@@ -2458,7 +2524,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2458,7 +2524,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) { if (OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) {
size += pb::CodedOutputStream.ComputeEnumSize(9, (int) OptimizeFor); size += pb::CodedOutputStream.ComputeEnumSize(9, (int) OptimizeFor);
} }
if (GoPackage != "") { if (GoPackage.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(11, GoPackage); size += pb::CodedOutputStream.ComputeStringSize(11, GoPackage);
} }
if (CcGenericServices != false) { if (CcGenericServices != false) {
...@@ -2476,14 +2542,16 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2476,14 +2542,16 @@ namespace Google.Protobuf.DescriptorProtos {
if (CcEnableArenas != false) { if (CcEnableArenas != false) {
size += pb::CodedOutputStream.ComputeBoolSize(31, CcEnableArenas); size += pb::CodedOutputStream.ComputeBoolSize(31, CcEnableArenas);
} }
if (ObjcClassPrefix != "") { if (ObjcClassPrefix.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(36, ObjcClassPrefix); size += pb::CodedOutputStream.ComputeStringSize(36, ObjcClassPrefix);
} }
if (CsharpNamespace != "") { if (CsharpNamespace.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(37, CsharpNamespace); size += pb::CodedOutputStream.ComputeStringSize(37, CsharpNamespace);
} }
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) { if (uninterpretedOption_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element);
}
} }
return size; return size;
} }
...@@ -2491,10 +2559,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2491,10 +2559,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.JavaPackage != "") { if (other.JavaPackage.Length != 0) {
JavaPackage = other.JavaPackage; JavaPackage = other.JavaPackage;
} }
if (other.JavaOuterClassname != "") { if (other.JavaOuterClassname.Length != 0) {
JavaOuterClassname = other.JavaOuterClassname; JavaOuterClassname = other.JavaOuterClassname;
} }
if (other.JavaMultipleFiles != false) { if (other.JavaMultipleFiles != false) {
...@@ -2509,7 +2577,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2509,7 +2577,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other.OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) { if (other.OptimizeFor != global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED) {
OptimizeFor = other.OptimizeFor; OptimizeFor = other.OptimizeFor;
} }
if (other.GoPackage != "") { if (other.GoPackage.Length != 0) {
GoPackage = other.GoPackage; GoPackage = other.GoPackage;
} }
if (other.CcGenericServices != false) { if (other.CcGenericServices != false) {
...@@ -2527,10 +2595,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2527,10 +2595,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (other.CcEnableArenas != false) { if (other.CcEnableArenas != false) {
CcEnableArenas = other.CcEnableArenas; CcEnableArenas = other.CcEnableArenas;
} }
if (other.ObjcClassPrefix != "") { if (other.ObjcClassPrefix.Length != 0) {
ObjcClassPrefix = other.ObjcClassPrefix; ObjcClassPrefix = other.ObjcClassPrefix;
} }
if (other.CsharpNamespace != "") { if (other.CsharpNamespace.Length != 0) {
CsharpNamespace = other.CsharpNamespace; CsharpNamespace = other.CsharpNamespace;
} }
uninterpretedOption_.Add(other.uninterpretedOption_); uninterpretedOption_.Add(other.uninterpretedOption_);
...@@ -2548,11 +2616,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2548,11 +2616,11 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
javaPackage_ = input.ReadString(); JavaPackage = input.ReadString();
break; break;
} }
case 66: { case 66: {
javaOuterClassname_ = input.ReadString(); JavaOuterClassname = input.ReadString();
break; break;
} }
case 72: { case 72: {
...@@ -2560,47 +2628,47 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2560,47 +2628,47 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 80: { case 80: {
javaMultipleFiles_ = input.ReadBool(); JavaMultipleFiles = input.ReadBool();
break; break;
} }
case 90: { case 90: {
goPackage_ = input.ReadString(); GoPackage = input.ReadString();
break; break;
} }
case 128: { case 128: {
ccGenericServices_ = input.ReadBool(); CcGenericServices = input.ReadBool();
break; break;
} }
case 136: { case 136: {
javaGenericServices_ = input.ReadBool(); JavaGenericServices = input.ReadBool();
break; break;
} }
case 144: { case 144: {
pyGenericServices_ = input.ReadBool(); PyGenericServices = input.ReadBool();
break; break;
} }
case 160: { case 160: {
javaGenerateEqualsAndHash_ = input.ReadBool(); JavaGenerateEqualsAndHash = input.ReadBool();
break; break;
} }
case 184: { case 184: {
deprecated_ = input.ReadBool(); Deprecated = input.ReadBool();
break; break;
} }
case 216: { case 216: {
javaStringCheckUtf8_ = input.ReadBool(); JavaStringCheckUtf8 = input.ReadBool();
break; break;
} }
case 248: { case 248: {
ccEnableArenas_ = input.ReadBool(); CcEnableArenas = input.ReadBool();
break; break;
} }
case 290: { case 290: {
objcClassPrefix_ = input.ReadString(); ObjcClassPrefix = input.ReadString();
break; break;
} }
case 298: { case 298: {
csharpNamespace_ = input.ReadString(); CsharpNamespace = input.ReadString();
break; break;
} }
case 7994: { case 7994: {
...@@ -2724,7 +2792,9 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2724,7 +2792,9 @@ namespace Google.Protobuf.DescriptorProtos {
if (MapEntry != false) { if (MapEntry != false) {
output.WriteBool(7, MapEntry); output.WriteBool(7, MapEntry);
} }
output.WriteMessageArray(999, uninterpretedOption_); if (uninterpretedOption_.Count > 0) {
output.WriteMessageArray(999, uninterpretedOption_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -2741,8 +2811,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2741,8 +2811,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (MapEntry != false) { if (MapEntry != false) {
size += pb::CodedOutputStream.ComputeBoolSize(7, MapEntry); size += pb::CodedOutputStream.ComputeBoolSize(7, MapEntry);
} }
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) { if (uninterpretedOption_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element);
}
} }
return size; return size;
} }
...@@ -2777,19 +2849,19 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2777,19 +2849,19 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 8: { case 8: {
messageSetWireFormat_ = input.ReadBool(); MessageSetWireFormat = input.ReadBool();
break; break;
} }
case 16: { case 16: {
noStandardDescriptorAccessor_ = input.ReadBool(); NoStandardDescriptorAccessor = input.ReadBool();
break; break;
} }
case 24: { case 24: {
deprecated_ = input.ReadBool(); Deprecated = input.ReadBool();
break; break;
} }
case 56: { case 56: {
mapEntry_ = input.ReadBool(); MapEntry = input.ReadBool();
break; break;
} }
case 7994: { case 7994: {
...@@ -2927,7 +2999,9 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2927,7 +2999,9 @@ namespace Google.Protobuf.DescriptorProtos {
if (Weak != false) { if (Weak != false) {
output.WriteBool(10, Weak); output.WriteBool(10, Weak);
} }
output.WriteMessageArray(999, uninterpretedOption_); if (uninterpretedOption_.Count > 0) {
output.WriteMessageArray(999, uninterpretedOption_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -2950,8 +3024,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2950,8 +3024,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (Weak != false) { if (Weak != false) {
size += pb::CodedOutputStream.ComputeBoolSize(10, Weak); size += pb::CodedOutputStream.ComputeBoolSize(10, Weak);
} }
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) { if (uninterpretedOption_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element);
}
} }
return size; return size;
} }
...@@ -2996,15 +3072,15 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -2996,15 +3072,15 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 16: { case 16: {
packed_ = input.ReadBool(); Packed = input.ReadBool();
break; break;
} }
case 24: { case 24: {
deprecated_ = input.ReadBool(); Deprecated = input.ReadBool();
break; break;
} }
case 40: { case 40: {
lazy_ = input.ReadBool(); Lazy = input.ReadBool();
break; break;
} }
case 48: { case 48: {
...@@ -3012,7 +3088,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3012,7 +3088,7 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 80: { case 80: {
weak_ = input.ReadBool(); Weak = input.ReadBool();
break; break;
} }
case 7994: { case 7994: {
...@@ -3116,7 +3192,9 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3116,7 +3192,9 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
output.WriteBool(3, Deprecated); output.WriteBool(3, Deprecated);
} }
output.WriteMessageArray(999, uninterpretedOption_); if (uninterpretedOption_.Count > 0) {
output.WriteMessageArray(999, uninterpretedOption_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -3127,8 +3205,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3127,8 +3205,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated); size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated);
} }
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) { if (uninterpretedOption_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element);
}
} }
return size; return size;
} }
...@@ -3157,11 +3237,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3157,11 +3237,11 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 16: { case 16: {
allowAlias_ = input.ReadBool(); AllowAlias = input.ReadBool();
break; break;
} }
case 24: { case 24: {
deprecated_ = input.ReadBool(); Deprecated = input.ReadBool();
break; break;
} }
case 7994: { case 7994: {
...@@ -3234,7 +3314,9 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3234,7 +3314,9 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
output.WriteBool(1, Deprecated); output.WriteBool(1, Deprecated);
} }
output.WriteMessageArray(999, uninterpretedOption_); if (uninterpretedOption_.Count > 0) {
output.WriteMessageArray(999, uninterpretedOption_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -3242,8 +3324,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3242,8 +3324,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
size += pb::CodedOutputStream.ComputeBoolSize(1, Deprecated); size += pb::CodedOutputStream.ComputeBoolSize(1, Deprecated);
} }
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) { if (uninterpretedOption_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element);
}
} }
return size; return size;
} }
...@@ -3269,7 +3353,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3269,7 +3353,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 8: { case 8: {
deprecated_ = input.ReadBool(); Deprecated = input.ReadBool();
break; break;
} }
case 7994: { case 7994: {
...@@ -3342,7 +3426,9 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3342,7 +3426,9 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
output.WriteBool(33, Deprecated); output.WriteBool(33, Deprecated);
} }
output.WriteMessageArray(999, uninterpretedOption_); if (uninterpretedOption_.Count > 0) {
output.WriteMessageArray(999, uninterpretedOption_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -3350,8 +3436,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3350,8 +3436,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
size += pb::CodedOutputStream.ComputeBoolSize(33, Deprecated); size += pb::CodedOutputStream.ComputeBoolSize(33, Deprecated);
} }
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) { if (uninterpretedOption_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element);
}
} }
return size; return size;
} }
...@@ -3377,7 +3465,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3377,7 +3465,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 264: { case 264: {
deprecated_ = input.ReadBool(); Deprecated = input.ReadBool();
break; break;
} }
case 7994: { case 7994: {
...@@ -3450,7 +3538,9 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3450,7 +3538,9 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
output.WriteBool(33, Deprecated); output.WriteBool(33, Deprecated);
} }
output.WriteMessageArray(999, uninterpretedOption_); if (uninterpretedOption_.Count > 0) {
output.WriteMessageArray(999, uninterpretedOption_);
}
} }
public int CalculateSize() { public int CalculateSize() {
...@@ -3458,8 +3548,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3458,8 +3548,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (Deprecated != false) { if (Deprecated != false) {
size += pb::CodedOutputStream.ComputeBoolSize(33, Deprecated); size += pb::CodedOutputStream.ComputeBoolSize(33, Deprecated);
} }
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) { if (uninterpretedOption_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption element in uninterpretedOption_) {
size += pb::CodedOutputStream.ComputeMessageSize(999, element);
}
} }
return size; return size;
} }
...@@ -3485,7 +3577,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3485,7 +3577,7 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 264: { case 264: {
deprecated_ = input.ReadBool(); Deprecated = input.ReadBool();
break; break;
} }
case 7994: { case 7994: {
...@@ -3595,18 +3687,20 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3595,18 +3687,20 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
hash ^= name_.GetHashCode(); hash ^= name_.GetHashCode();
if (IdentifierValue != "") hash ^= IdentifierValue.GetHashCode(); if (IdentifierValue.Length != 0) hash ^= IdentifierValue.GetHashCode();
if (PositiveIntValue != 0UL) hash ^= PositiveIntValue.GetHashCode(); if (PositiveIntValue != 0UL) hash ^= PositiveIntValue.GetHashCode();
if (NegativeIntValue != 0L) hash ^= NegativeIntValue.GetHashCode(); if (NegativeIntValue != 0L) hash ^= NegativeIntValue.GetHashCode();
if (DoubleValue != 0D) hash ^= DoubleValue.GetHashCode(); if (DoubleValue != 0D) hash ^= DoubleValue.GetHashCode();
if (StringValue != pb::ByteString.Empty) hash ^= StringValue.GetHashCode(); if (StringValue.Length != 0) hash ^= StringValue.GetHashCode();
if (AggregateValue != "") hash ^= AggregateValue.GetHashCode(); if (AggregateValue.Length != 0) hash ^= AggregateValue.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WriteMessageArray(2, name_); if (name_.Count > 0) {
if (IdentifierValue != "") { output.WriteMessageArray(2, name_);
}
if (IdentifierValue.Length != 0) {
output.WriteString(3, IdentifierValue); output.WriteString(3, IdentifierValue);
} }
if (PositiveIntValue != 0UL) { if (PositiveIntValue != 0UL) {
...@@ -3618,20 +3712,22 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3618,20 +3712,22 @@ namespace Google.Protobuf.DescriptorProtos {
if (DoubleValue != 0D) { if (DoubleValue != 0D) {
output.WriteDouble(6, DoubleValue); output.WriteDouble(6, DoubleValue);
} }
if (StringValue != pb::ByteString.Empty) { if (StringValue.Length != 0) {
output.WriteBytes(7, StringValue); output.WriteBytes(7, StringValue);
} }
if (AggregateValue != "") { if (AggregateValue.Length != 0) {
output.WriteString(8, AggregateValue); output.WriteString(8, AggregateValue);
} }
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Types.NamePart element in name_) { if (name_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element); foreach (global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Types.NamePart element in name_) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
}
} }
if (IdentifierValue != "") { if (IdentifierValue.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(3, IdentifierValue); size += pb::CodedOutputStream.ComputeStringSize(3, IdentifierValue);
} }
if (PositiveIntValue != 0UL) { if (PositiveIntValue != 0UL) {
...@@ -3643,10 +3739,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3643,10 +3739,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (DoubleValue != 0D) { if (DoubleValue != 0D) {
size += pb::CodedOutputStream.ComputeDoubleSize(6, DoubleValue); size += pb::CodedOutputStream.ComputeDoubleSize(6, DoubleValue);
} }
if (StringValue != pb::ByteString.Empty) { if (StringValue.Length != 0) {
size += pb::CodedOutputStream.ComputeBytesSize(7, StringValue); size += pb::CodedOutputStream.ComputeBytesSize(7, StringValue);
} }
if (AggregateValue != "") { if (AggregateValue.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(8, AggregateValue); size += pb::CodedOutputStream.ComputeStringSize(8, AggregateValue);
} }
return size; return size;
...@@ -3656,7 +3752,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3656,7 +3752,7 @@ namespace Google.Protobuf.DescriptorProtos {
return; return;
} }
name_.Add(other.name_); name_.Add(other.name_);
if (other.IdentifierValue != "") { if (other.IdentifierValue.Length != 0) {
IdentifierValue = other.IdentifierValue; IdentifierValue = other.IdentifierValue;
} }
if (other.PositiveIntValue != 0UL) { if (other.PositiveIntValue != 0UL) {
...@@ -3668,10 +3764,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3668,10 +3764,10 @@ namespace Google.Protobuf.DescriptorProtos {
if (other.DoubleValue != 0D) { if (other.DoubleValue != 0D) {
DoubleValue = other.DoubleValue; DoubleValue = other.DoubleValue;
} }
if (other.StringValue != pb::ByteString.Empty) { if (other.StringValue.Length != 0) {
StringValue = other.StringValue; StringValue = other.StringValue;
} }
if (other.AggregateValue != "") { if (other.AggregateValue.Length != 0) {
AggregateValue = other.AggregateValue; AggregateValue = other.AggregateValue;
} }
} }
...@@ -3692,27 +3788,27 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3692,27 +3788,27 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 26: { case 26: {
identifierValue_ = input.ReadString(); IdentifierValue = input.ReadString();
break; break;
} }
case 32: { case 32: {
positiveIntValue_ = input.ReadUInt64(); PositiveIntValue = input.ReadUInt64();
break; break;
} }
case 40: { case 40: {
negativeIntValue_ = input.ReadInt64(); NegativeIntValue = input.ReadInt64();
break; break;
} }
case 49: { case 49: {
doubleValue_ = input.ReadDouble(); DoubleValue = input.ReadDouble();
break; break;
} }
case 58: { case 58: {
stringValue_ = input.ReadBytes(); StringValue = input.ReadBytes();
break; break;
} }
case 66: { case 66: {
aggregateValue_ = input.ReadString(); AggregateValue = input.ReadString();
break; break;
} }
} }
...@@ -3775,13 +3871,13 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3775,13 +3871,13 @@ namespace Google.Protobuf.DescriptorProtos {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 0;
if (NamePart_ != "") hash ^= NamePart_.GetHashCode(); if (NamePart_.Length != 0) hash ^= NamePart_.GetHashCode();
if (IsExtension != false) hash ^= IsExtension.GetHashCode(); if (IsExtension != false) hash ^= IsExtension.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (NamePart_ != "") { if (NamePart_.Length != 0) {
output.WriteString(1, NamePart_); output.WriteString(1, NamePart_);
} }
if (IsExtension != false) { if (IsExtension != false) {
...@@ -3791,7 +3887,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3791,7 +3887,7 @@ namespace Google.Protobuf.DescriptorProtos {
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (NamePart_ != "") { if (NamePart_.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(1, NamePart_); size += pb::CodedOutputStream.ComputeStringSize(1, NamePart_);
} }
if (IsExtension != false) { if (IsExtension != false) {
...@@ -3803,7 +3899,7 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3803,7 +3899,7 @@ namespace Google.Protobuf.DescriptorProtos {
if (other == null) { if (other == null) {
return; return;
} }
if (other.NamePart_ != "") { if (other.NamePart_.Length != 0) {
NamePart_ = other.NamePart_; NamePart_ = other.NamePart_;
} }
if (other.IsExtension != false) { if (other.IsExtension != false) {
...@@ -3823,11 +3919,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3823,11 +3919,11 @@ namespace Google.Protobuf.DescriptorProtos {
} }
break; break;
case 10: { case 10: {
namePart_ = input.ReadString(); NamePart_ = input.ReadString();
break; break;
} }
case 16: { case 16: {
isExtension_ = input.ReadBool(); IsExtension = input.ReadBool();
break; break;
} }
} }
...@@ -3888,13 +3984,17 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -3888,13 +3984,17 @@ namespace Google.Protobuf.DescriptorProtos {
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WriteMessageArray(1, location_); if (location_.Count > 0) {
output.WriteMessageArray(1, location_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
foreach (global::Google.Protobuf.DescriptorProtos.SourceCodeInfo.Types.Location element in location_) { if (location_.Count > 0) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element); foreach (global::Google.Protobuf.DescriptorProtos.SourceCodeInfo.Types.Location element in location_) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
} }
return size; return size;
} }
...@@ -4003,53 +4103,55 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4003,53 +4103,55 @@ namespace Google.Protobuf.DescriptorProtos {
int hash = 0; int hash = 0;
hash ^= path_.GetHashCode(); hash ^= path_.GetHashCode();
hash ^= span_.GetHashCode(); hash ^= span_.GetHashCode();
if (LeadingComments != "") hash ^= LeadingComments.GetHashCode(); if (LeadingComments.Length != 0) hash ^= LeadingComments.GetHashCode();
if (TrailingComments != "") hash ^= TrailingComments.GetHashCode(); if (TrailingComments.Length != 0) hash ^= TrailingComments.GetHashCode();
hash ^= leadingDetachedComments_.GetHashCode(); hash ^= leadingDetachedComments_.GetHashCode();
return hash; return hash;
} }
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
output.WritePackedInt32Array(1, path_); if (path_.Count > 0) {
output.WritePackedInt32Array(2, span_); output.WritePackedInt32Array(1, path_);
if (LeadingComments != "") { }
if (span_.Count > 0) {
output.WritePackedInt32Array(2, span_);
}
if (LeadingComments.Length != 0) {
output.WriteString(3, LeadingComments); output.WriteString(3, LeadingComments);
} }
if (TrailingComments != "") { if (TrailingComments.Length != 0) {
output.WriteString(4, TrailingComments); output.WriteString(4, TrailingComments);
} }
output.WriteStringArray(6, leadingDetachedComments_); if (leadingDetachedComments_.Count > 0) {
output.WriteStringArray(6, leadingDetachedComments_);
}
} }
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
{ if (path_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in path_) { foreach (int element in path_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (path_.Count != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
{ if (span_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (int element in span_) { foreach (int element in span_) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
} }
size += dataSize; size += dataSize;
if (span_.Count != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
}
} }
if (LeadingComments != "") { if (LeadingComments.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(3, LeadingComments); size += pb::CodedOutputStream.ComputeStringSize(3, LeadingComments);
} }
if (TrailingComments != "") { if (TrailingComments.Length != 0) {
size += pb::CodedOutputStream.ComputeStringSize(4, TrailingComments); size += pb::CodedOutputStream.ComputeStringSize(4, TrailingComments);
} }
{ if (leadingDetachedComments_.Count > 0) {
int dataSize = 0; int dataSize = 0;
foreach (string element in leadingDetachedComments_) { foreach (string element in leadingDetachedComments_) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
...@@ -4065,10 +4167,10 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4065,10 +4167,10 @@ namespace Google.Protobuf.DescriptorProtos {
} }
path_.Add(other.path_); path_.Add(other.path_);
span_.Add(other.span_); span_.Add(other.span_);
if (other.LeadingComments != "") { if (other.LeadingComments.Length != 0) {
LeadingComments = other.LeadingComments; LeadingComments = other.LeadingComments;
} }
if (other.TrailingComments != "") { if (other.TrailingComments.Length != 0) {
TrailingComments = other.TrailingComments; TrailingComments = other.TrailingComments;
} }
leadingDetachedComments_.Add(other.leadingDetachedComments_); leadingDetachedComments_.Add(other.leadingDetachedComments_);
...@@ -4096,11 +4198,11 @@ namespace Google.Protobuf.DescriptorProtos { ...@@ -4096,11 +4198,11 @@ namespace Google.Protobuf.DescriptorProtos {
break; break;
} }
case 26: { case 26: {
leadingComments_ = input.ReadString(); LeadingComments = input.ReadString();
break; break;
} }
case 34: { case 34: {
trailingComments_ = input.ReadString(); TrailingComments = input.ReadString();
break; break;
} }
case 50: { case 50: {
......
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