We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6bd276 commit 7997221Copy full SHA for 7997221
Sources/protoc-gen-swift/OneofGenerator.swift
@@ -71,14 +71,9 @@ class OneofGenerator {
71
// }
72
// int32 m = 13;
73
74
+ let sortedOneofFieldNumbers = fieldsSortedByNumber.map { $0.number }
75
let firstIndex = parentFieldNumbersSorted.index(of: first)!
- var isContinuousInParent = true
76
- for i in 0..<fields.count {
77
- if fieldsSortedByNumber[i].number != parentFieldNumbersSorted[firstIndex + i] {
78
- isContinuousInParent = false
79
- break
80
- }
81
+ var isContinuousInParent = sortedOneofFieldNumbers == Array(parentFieldNumbersSorted[firstIndex..<(firstIndex + fields.count)])
82
if isContinuousInParent {
83
// Make sure there isn't an extension range in the middle of the fields.
84
// message AlsoBad {
0 commit comments