|
|
@@ -380,7 +380,7 @@ public final class FileDescriptor {
|
|
|
// The compiler ensures there aren't cycles between a file and dependencies, so
|
|
|
// this doesn't run the risk of creating any retain cycles that would force these
|
|
|
// to have to be weak.
|
|
|
- let dependencies = proto.dependency.map { return registry.fileDescriptor(named: $0)! }
|
|
|
+ let dependencies = proto.dependency.map { registry.fileDescriptor(named: $0)! }
|
|
|
self.dependencies = dependencies
|
|
|
self.publicDependencies = proto.publicDependency.map { dependencies[Int($0)] }
|
|
|
self.weakDependencies = proto.weakDependency.map { dependencies[Int($0)] }
|
|
|
@@ -418,7 +418,7 @@ public final class FileDescriptor {
|
|
|
private lazy var locationMap: [IndexPath: Google_Protobuf_SourceCodeInfo.Location] = {
|
|
|
var result: [IndexPath: Google_Protobuf_SourceCodeInfo.Location] = [:]
|
|
|
for loc in sourceCodeInfo.location {
|
|
|
- let intList = loc.path.map { return Int($0) }
|
|
|
+ let intList = loc.path.map { Int($0) }
|
|
|
result[IndexPath(indexes: intList)] = loc
|
|
|
}
|
|
|
return result
|
|
|
@@ -569,7 +569,7 @@ public final class Descriptor {
|
|
|
/// leading subset of `oneofs` (or the same if there are no synthetic entries).
|
|
|
public private(set) lazy var realOneofs: [OneofDescriptor] = {
|
|
|
// Lazy because `isSynthetic` can't be called until after `bind()`.
|
|
|
- return self.oneofs.filter { !$0._isSynthetic }
|
|
|
+ self.oneofs.filter { !$0._isSynthetic }
|
|
|
}()
|
|
|
/// The extension field defintions under this message.
|
|
|
public let extensions: [FieldDescriptor]
|
|
|
@@ -590,7 +590,7 @@ public final class Descriptor {
|
|
|
/// contiguious (i.e. - [(21,30),(10,20)] -> [(10,30)])
|
|
|
@available(*, deprecated, message: "Please open a GitHub issue if you think functionality is missing.")
|
|
|
public private(set) lazy var normalizedExtensionRanges: [Google_Protobuf_DescriptorProto.ExtensionRange] = {
|
|
|
- var ordered = self.extensionRanges.sorted(by: { return $0.start < $1.start })
|
|
|
+ var ordered = self.extensionRanges.sorted(by: { $0.start < $1.start })
|
|
|
if ordered.count > 1 {
|
|
|
for i in (0..<(ordered.count - 1)).reversed() {
|
|
|
if ordered[i].end == ordered[i + 1].start {
|
|
|
@@ -688,7 +688,7 @@ public final class Descriptor {
|
|
|
// TODO: This can skip the synthetic oneofs as no features can be set on
|
|
|
// them to inherrit things.
|
|
|
let oneofFeatures = proto.oneofDecl.map {
|
|
|
- return featureResolver.resolve($0.options, resolvedParent: resolvedFeatures)
|
|
|
+ featureResolver.resolve($0.options, resolvedParent: resolvedFeatures)
|
|
|
}
|
|
|
|
|
|
self.messageExtensionRanges = proto.extensionRange.enumerated().map {
|