Regenerate C# code with the new generator, adding unittest_proto3_optional.proto
The changes in the existing proto2 code are solely around presence bits. The new generator allocated presence bits more efficiently. (Previously bits were sometimes allocated but never used.)
diff --git a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs
index a35b6e0..25fecb9 100644
--- a/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs
+++ b/csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs
@@ -15521,7 +15521,6 @@
public sealed partial class TestOneof : pb::IMessage<TestOneof> {
private static readonly pb::MessageParser<TestOneof> _parser = new pb::MessageParser<TestOneof>(() => new TestOneof());
private pb::UnknownFieldSet _unknownFields;
- private int _hasBits0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestOneof> Parser { get { return _parser; } }
@@ -15544,7 +15543,6 @@
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestOneof(TestOneof other) : this() {
- _hasBits0 = other._hasBits0;
switch (other.FooCase) {
case FooOneofCase.FooInt:
FooInt = other.FooInt;
@@ -16934,21 +16932,21 @@
private int bazInt_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int BazInt {
- get { if ((_hasBits0 & 16) != 0) { return bazInt_; } else { return BazIntDefaultValue; } }
+ get { if ((_hasBits0 & 1) != 0) { return bazInt_; } else { return BazIntDefaultValue; } }
set {
- _hasBits0 |= 16;
+ _hasBits0 |= 1;
bazInt_ = value;
}
}
/// <summary>Gets whether the "baz_int" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasBazInt {
- get { return (_hasBits0 & 16) != 0; }
+ get { return (_hasBits0 & 1) != 0; }
}
/// <summary>Clears the value of the "baz_int" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearBazInt() {
- _hasBits0 &= ~16;
+ _hasBits0 &= ~1;
}
/// <summary>Field number for the "baz_string" field.</summary>
@@ -17767,7 +17765,6 @@
public sealed partial class TestRequiredOneof : pb::IMessage<TestRequiredOneof> {
private static readonly pb::MessageParser<TestRequiredOneof> _parser = new pb::MessageParser<TestRequiredOneof>(() => new TestRequiredOneof());
private pb::UnknownFieldSet _unknownFields;
- private int _hasBits0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TestRequiredOneof> Parser { get { return _parser; } }
@@ -17790,7 +17787,6 @@
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TestRequiredOneof(TestRequiredOneof other) : this() {
- _hasBits0 = other._hasBits0;
switch (other.FooCase) {
case FooOneofCase.FooInt:
FooInt = other.FooInt;