Skip to content

Commit c1adb3c

Browse files
authored
Remove extra blank line; fix equality short circuiting. (apple#310)
* Remove extra blank line in some generated code and add short circuiting based on storage identity. * Regenerate protos. * Regenerate reference protos.
1 parent 0527de2 commit c1adb3c

File tree

92 files changed

+4261
-4065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4261
-4065
lines changed

Reference/conformance/conformance.pb.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ struct Conformance_ConformanceRequest: SwiftProtobuf.Proto3Message, SwiftProtobu
173173
/// Which format should the testee serialize its message to?
174174
var requestedOutputFormat: Conformance_WireFormat = Conformance_WireFormat.unspecified
175175

176-
177176
enum OneOf_Payload: Equatable {
178177
case protobufPayload(Data)
179178
case jsonPayload(String)
@@ -356,7 +355,6 @@ struct Conformance_ConformanceResponse: SwiftProtobuf.Proto3Message, SwiftProtob
356355
}
357356
}
358357

359-
360358
enum OneOf_Result: Equatable {
361359
case parseError(String)
362360
case serializeError(String)

Reference/google/protobuf/any.pb.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ struct Google_Protobuf_Any: SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageI
151151
/// Must be a valid serialized protocol buffer of the above specified type.
152152
var value: Data = Data()
153153

154-
155154
init() {}
156155

157156
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {

Reference/google/protobuf/any_test.pb.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ struct ProtobufUnittest_TestAny: SwiftProtobuf.Proto3Message, SwiftProtobuf._Mes
104104
set {_uniqueStorage()._repeatedAnyValue = newValue}
105105
}
106106

107-
108107
init() {}
109108

110109
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
@@ -140,9 +139,11 @@ struct ProtobufUnittest_TestAny: SwiftProtobuf.Proto3Message, SwiftProtobuf._Mes
140139

141140
func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestAny) -> Bool {
142141
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
143-
if _storage._int32Value != other_storage._int32Value {return false}
144-
if _storage._anyValue != other_storage._anyValue {return false}
145-
if _storage._repeatedAnyValue != other_storage._repeatedAnyValue {return false}
142+
if _storage !== other_storage {
143+
if _storage._int32Value != other_storage._int32Value {return false}
144+
if _storage._anyValue != other_storage._anyValue {return false}
145+
if _storage._repeatedAnyValue != other_storage._repeatedAnyValue {return false}
146+
}
146147
return true
147148
}
148149
}

Reference/google/protobuf/api.pb.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ struct Google_Protobuf_Api: SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageI
164164
set {_uniqueStorage()._syntax = newValue}
165165
}
166166

167-
168167
init() {}
169168

170169
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
@@ -216,13 +215,15 @@ struct Google_Protobuf_Api: SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageI
216215

217216
func _protoc_generated_isEqualTo(other: Google_Protobuf_Api) -> Bool {
218217
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
219-
if _storage._name != other_storage._name {return false}
220-
if _storage._methods != other_storage._methods {return false}
221-
if _storage._options != other_storage._options {return false}
222-
if _storage._version != other_storage._version {return false}
223-
if _storage._sourceContext != other_storage._sourceContext {return false}
224-
if _storage._mixins != other_storage._mixins {return false}
225-
if _storage._syntax != other_storage._syntax {return false}
218+
if _storage !== other_storage {
219+
if _storage._name != other_storage._name {return false}
220+
if _storage._methods != other_storage._methods {return false}
221+
if _storage._options != other_storage._options {return false}
222+
if _storage._version != other_storage._version {return false}
223+
if _storage._sourceContext != other_storage._sourceContext {return false}
224+
if _storage._mixins != other_storage._mixins {return false}
225+
if _storage._syntax != other_storage._syntax {return false}
226+
}
226227
return true
227228
}
228229
}
@@ -263,7 +264,6 @@ struct Google_Protobuf_Method: SwiftProtobuf.Proto3Message, SwiftProtobuf._Messa
263264
/// The source syntax of this method.
264265
var syntax: Google_Protobuf_Syntax = Google_Protobuf_Syntax.proto2
265266

266-
267267
init() {}
268268

269269
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
@@ -413,7 +413,6 @@ struct Google_Protobuf_Mixin: SwiftProtobuf.Proto3Message, SwiftProtobuf._Messag
413413
/// are rooted.
414414
var root: String = ""
415415

416-
417416
init() {}
418417

419418
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {

Reference/google/protobuf/compiler/plugin.pb.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,12 @@ struct Google_Protobuf_Compiler_CodeGeneratorRequest: SwiftProtobuf.Proto2Messag
307307

308308
func _protoc_generated_isEqualTo(other: Google_Protobuf_Compiler_CodeGeneratorRequest) -> Bool {
309309
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
310-
if _storage._fileToGenerate != other_storage._fileToGenerate {return false}
311-
if _storage._parameter != other_storage._parameter {return false}
312-
if _storage._protoFile != other_storage._protoFile {return false}
313-
if _storage._compilerVersion != other_storage._compilerVersion {return false}
310+
if _storage !== other_storage {
311+
if _storage._fileToGenerate != other_storage._fileToGenerate {return false}
312+
if _storage._parameter != other_storage._parameter {return false}
313+
if _storage._protoFile != other_storage._protoFile {return false}
314+
if _storage._compilerVersion != other_storage._compilerVersion {return false}
315+
}
314316
if unknownFields != other.unknownFields {return false}
315317
return true
316318
}

Reference/google/protobuf/descriptor.pb.swift

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,20 @@ struct Google_Protobuf_FileDescriptorProto: SwiftProtobuf.Proto2Message, SwiftPr
354354

355355
func _protoc_generated_isEqualTo(other: Google_Protobuf_FileDescriptorProto) -> Bool {
356356
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
357-
if _storage._name != other_storage._name {return false}
358-
if _storage._package != other_storage._package {return false}
359-
if _storage._dependency != other_storage._dependency {return false}
360-
if _storage._publicDependency != other_storage._publicDependency {return false}
361-
if _storage._weakDependency != other_storage._weakDependency {return false}
362-
if _storage._messageType != other_storage._messageType {return false}
363-
if _storage._enumType != other_storage._enumType {return false}
364-
if _storage._service != other_storage._service {return false}
365-
if _storage._extension_p != other_storage._extension_p {return false}
366-
if _storage._options != other_storage._options {return false}
367-
if _storage._sourceCodeInfo != other_storage._sourceCodeInfo {return false}
368-
if _storage._syntax != other_storage._syntax {return false}
357+
if _storage !== other_storage {
358+
if _storage._name != other_storage._name {return false}
359+
if _storage._package != other_storage._package {return false}
360+
if _storage._dependency != other_storage._dependency {return false}
361+
if _storage._publicDependency != other_storage._publicDependency {return false}
362+
if _storage._weakDependency != other_storage._weakDependency {return false}
363+
if _storage._messageType != other_storage._messageType {return false}
364+
if _storage._enumType != other_storage._enumType {return false}
365+
if _storage._service != other_storage._service {return false}
366+
if _storage._extension_p != other_storage._extension_p {return false}
367+
if _storage._options != other_storage._options {return false}
368+
if _storage._sourceCodeInfo != other_storage._sourceCodeInfo {return false}
369+
if _storage._syntax != other_storage._syntax {return false}
370+
}
369371
if unknownFields != other.unknownFields {return false}
370372
return true
371373
}
@@ -711,16 +713,18 @@ struct Google_Protobuf_DescriptorProto: SwiftProtobuf.Proto2Message, SwiftProtob
711713

712714
func _protoc_generated_isEqualTo(other: Google_Protobuf_DescriptorProto) -> Bool {
713715
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
714-
if _storage._name != other_storage._name {return false}
715-
if _storage._field != other_storage._field {return false}
716-
if _storage._extension_p != other_storage._extension_p {return false}
717-
if _storage._nestedType != other_storage._nestedType {return false}
718-
if _storage._enumType != other_storage._enumType {return false}
719-
if _storage._extensionRange != other_storage._extensionRange {return false}
720-
if _storage._oneofDecl != other_storage._oneofDecl {return false}
721-
if _storage._options != other_storage._options {return false}
722-
if _storage._reservedRange != other_storage._reservedRange {return false}
723-
if _storage._reservedName != other_storage._reservedName {return false}
716+
if _storage !== other_storage {
717+
if _storage._name != other_storage._name {return false}
718+
if _storage._field != other_storage._field {return false}
719+
if _storage._extension_p != other_storage._extension_p {return false}
720+
if _storage._nestedType != other_storage._nestedType {return false}
721+
if _storage._enumType != other_storage._enumType {return false}
722+
if _storage._extensionRange != other_storage._extensionRange {return false}
723+
if _storage._oneofDecl != other_storage._oneofDecl {return false}
724+
if _storage._options != other_storage._options {return false}
725+
if _storage._reservedRange != other_storage._reservedRange {return false}
726+
if _storage._reservedName != other_storage._reservedName {return false}
727+
}
724728
if unknownFields != other.unknownFields {return false}
725729
return true
726730
}
@@ -1218,16 +1222,18 @@ struct Google_Protobuf_FieldDescriptorProto: SwiftProtobuf.Proto2Message, SwiftP
12181222

12191223
func _protoc_generated_isEqualTo(other: Google_Protobuf_FieldDescriptorProto) -> Bool {
12201224
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1221-
if _storage._name != other_storage._name {return false}
1222-
if _storage._number != other_storage._number {return false}
1223-
if _storage._label != other_storage._label {return false}
1224-
if _storage._type != other_storage._type {return false}
1225-
if _storage._typeName != other_storage._typeName {return false}
1226-
if _storage._extendee != other_storage._extendee {return false}
1227-
if _storage._defaultValue != other_storage._defaultValue {return false}
1228-
if _storage._oneofIndex != other_storage._oneofIndex {return false}
1229-
if _storage._jsonName != other_storage._jsonName {return false}
1230-
if _storage._options != other_storage._options {return false}
1225+
if _storage !== other_storage {
1226+
if _storage._name != other_storage._name {return false}
1227+
if _storage._number != other_storage._number {return false}
1228+
if _storage._label != other_storage._label {return false}
1229+
if _storage._type != other_storage._type {return false}
1230+
if _storage._typeName != other_storage._typeName {return false}
1231+
if _storage._extendee != other_storage._extendee {return false}
1232+
if _storage._defaultValue != other_storage._defaultValue {return false}
1233+
if _storage._oneofIndex != other_storage._oneofIndex {return false}
1234+
if _storage._jsonName != other_storage._jsonName {return false}
1235+
if _storage._options != other_storage._options {return false}
1236+
}
12311237
if unknownFields != other.unknownFields {return false}
12321238
return true
12331239
}
@@ -1329,8 +1335,10 @@ struct Google_Protobuf_OneofDescriptorProto: SwiftProtobuf.Proto2Message, SwiftP
13291335

13301336
func _protoc_generated_isEqualTo(other: Google_Protobuf_OneofDescriptorProto) -> Bool {
13311337
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1332-
if _storage._name != other_storage._name {return false}
1333-
if _storage._options != other_storage._options {return false}
1338+
if _storage !== other_storage {
1339+
if _storage._name != other_storage._name {return false}
1340+
if _storage._options != other_storage._options {return false}
1341+
}
13341342
if unknownFields != other.unknownFields {return false}
13351343
return true
13361344
}
@@ -1445,9 +1453,11 @@ struct Google_Protobuf_EnumDescriptorProto: SwiftProtobuf.Proto2Message, SwiftPr
14451453

14461454
func _protoc_generated_isEqualTo(other: Google_Protobuf_EnumDescriptorProto) -> Bool {
14471455
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1448-
if _storage._name != other_storage._name {return false}
1449-
if _storage._value != other_storage._value {return false}
1450-
if _storage._options != other_storage._options {return false}
1456+
if _storage !== other_storage {
1457+
if _storage._name != other_storage._name {return false}
1458+
if _storage._value != other_storage._value {return false}
1459+
if _storage._options != other_storage._options {return false}
1460+
}
14511461
if unknownFields != other.unknownFields {return false}
14521462
return true
14531463
}
@@ -1567,9 +1577,11 @@ struct Google_Protobuf_EnumValueDescriptorProto: SwiftProtobuf.Proto2Message, Sw
15671577

15681578
func _protoc_generated_isEqualTo(other: Google_Protobuf_EnumValueDescriptorProto) -> Bool {
15691579
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1570-
if _storage._name != other_storage._name {return false}
1571-
if _storage._number != other_storage._number {return false}
1572-
if _storage._options != other_storage._options {return false}
1580+
if _storage !== other_storage {
1581+
if _storage._name != other_storage._name {return false}
1582+
if _storage._number != other_storage._number {return false}
1583+
if _storage._options != other_storage._options {return false}
1584+
}
15731585
if unknownFields != other.unknownFields {return false}
15741586
return true
15751587
}
@@ -1684,9 +1696,11 @@ struct Google_Protobuf_ServiceDescriptorProto: SwiftProtobuf.Proto2Message, Swif
16841696

16851697
func _protoc_generated_isEqualTo(other: Google_Protobuf_ServiceDescriptorProto) -> Bool {
16861698
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1687-
if _storage._name != other_storage._name {return false}
1688-
if _storage._method != other_storage._method {return false}
1689-
if _storage._options != other_storage._options {return false}
1699+
if _storage !== other_storage {
1700+
if _storage._name != other_storage._name {return false}
1701+
if _storage._method != other_storage._method {return false}
1702+
if _storage._options != other_storage._options {return false}
1703+
}
16901704
if unknownFields != other.unknownFields {return false}
16911705
return true
16921706
}
@@ -1864,12 +1878,14 @@ struct Google_Protobuf_MethodDescriptorProto: SwiftProtobuf.Proto2Message, Swift
18641878

18651879
func _protoc_generated_isEqualTo(other: Google_Protobuf_MethodDescriptorProto) -> Bool {
18661880
return withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1867-
if _storage._name != other_storage._name {return false}
1868-
if _storage._inputType != other_storage._inputType {return false}
1869-
if _storage._outputType != other_storage._outputType {return false}
1870-
if _storage._options != other_storage._options {return false}
1871-
if _storage._clientStreaming != other_storage._clientStreaming {return false}
1872-
if _storage._serverStreaming != other_storage._serverStreaming {return false}
1881+
if _storage !== other_storage {
1882+
if _storage._name != other_storage._name {return false}
1883+
if _storage._inputType != other_storage._inputType {return false}
1884+
if _storage._outputType != other_storage._outputType {return false}
1885+
if _storage._options != other_storage._options {return false}
1886+
if _storage._clientStreaming != other_storage._clientStreaming {return false}
1887+
if _storage._serverStreaming != other_storage._serverStreaming {return false}
1888+
}
18731889
if unknownFields != other.unknownFields {return false}
18741890
return true
18751891
}

Reference/google/protobuf/duration.pb.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ struct Google_Protobuf_Duration: SwiftProtobuf.Proto3Message, SwiftProtobuf._Mes
114114
/// to +999,999,999 inclusive.
115115
var nanos: Int32 = 0
116116

117-
118117
init() {}
119118

120119
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {

Reference/google/protobuf/empty.pb.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ struct Google_Protobuf_Empty: SwiftProtobuf.Proto3Message, SwiftProtobuf._Messag
6262
static let protoPackageName: String = "google.protobuf"
6363
static let _protobuf_fieldNames = FieldNameMap()
6464

65-
6665
init() {}
6766

6867
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {

Reference/google/protobuf/field_mask.pb.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ struct Google_Protobuf_FieldMask: SwiftProtobuf.Proto3Message, SwiftProtobuf._Me
259259
/// The set of field mask paths.
260260
var paths: [String] = []
261261

262-
263262
init() {}
264263

265264
mutating func _protoc_generated_decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {

0 commit comments

Comments
 (0)