@@ -380,7 +380,7 @@ public final class FileDescriptor {
380
380
// The compiler ensures there aren't cycles between a file and dependencies, so
381
381
// this doesn't run the risk of creating any retain cycles that would force these
382
382
// to have to be weak.
383
- let dependencies = proto. dependency. map { return registry. fileDescriptor ( named: $0) ! }
383
+ let dependencies = proto. dependency. map { registry. fileDescriptor ( named: $0) ! }
384
384
self . dependencies = dependencies
385
385
self . publicDependencies = proto. publicDependency. map { dependencies [ Int ( $0) ] }
386
386
self . weakDependencies = proto. weakDependency. map { dependencies [ Int ( $0) ] }
@@ -394,10 +394,10 @@ public final class FileDescriptor {
394
394
395
395
// descriptor.proto documents the files will be in deps order. That means we
396
396
// any external reference will have been in the previous files in the set.
397
- self . enums. forEach { $0 . bind ( file: self , registry: registry, containingType: nil ) }
398
- self . messages. forEach { $0 . bind ( file: self , registry: registry, containingType: nil ) }
399
- self . extensions. forEach { $0 . bind ( file: self , registry: registry, containingType: nil ) }
400
- self . services. forEach { $0 . bind ( file: self , registry: registry) }
397
+ for e in enums { e . bind ( file: self , registry: registry, containingType: nil ) }
398
+ for m in messages { m . bind ( file: self , registry: registry, containingType: nil ) }
399
+ for e in extensions { e . bind ( file: self , registry: registry, containingType: nil ) }
400
+ for s in services { s . bind ( file: self , registry: registry) }
401
401
}
402
402
403
403
/// Fetch the source information for a give path. For more details on the paths
@@ -418,7 +418,7 @@ public final class FileDescriptor {
418
418
private lazy var locationMap : [ IndexPath : Google_Protobuf_SourceCodeInfo . Location ] = {
419
419
var result : [ IndexPath : Google_Protobuf_SourceCodeInfo . Location ] = [ : ]
420
420
for loc in sourceCodeInfo. location {
421
- let intList = loc. path. map { return Int ( $0) }
421
+ let intList = loc. path. map { Int ( $0) }
422
422
result [ IndexPath ( indexes: intList) ] = loc
423
423
}
424
424
return result
@@ -569,7 +569,7 @@ public final class Descriptor {
569
569
/// leading subset of `oneofs` (or the same if there are no synthetic entries).
570
570
public private( set) lazy var realOneofs : [ OneofDescriptor ] = {
571
571
// Lazy because `isSynthetic` can't be called until after `bind()`.
572
- return self . oneofs. filter { !$0. _isSynthetic }
572
+ self . oneofs. filter { !$0. _isSynthetic }
573
573
} ( )
574
574
/// The extension field defintions under this message.
575
575
public let extensions : [ FieldDescriptor ]
@@ -590,7 +590,7 @@ public final class Descriptor {
590
590
/// contiguious (i.e. - [(21,30),(10,20)] -> [(10,30)])
591
591
@available ( * , deprecated, message: " Please open a GitHub issue if you think functionality is missing. " )
592
592
public private( set) lazy var normalizedExtensionRanges : [ Google_Protobuf_DescriptorProto . ExtensionRange ] = {
593
- var ordered = self . extensionRanges. sorted ( by: { return $0. start < $1. start } )
593
+ var ordered = self . extensionRanges. sorted ( by: { $0. start < $1. start } )
594
594
if ordered. count > 1 {
595
595
for i in ( 0 ..< ( ordered. count - 1 ) ) . reversed ( ) {
596
596
if ordered [ i] . end == ordered [ i + 1 ] . start {
@@ -688,7 +688,7 @@ public final class Descriptor {
688
688
// TODO: This can skip the synthetic oneofs as no features can be set on
689
689
// them to inherrit things.
690
690
let oneofFeatures = proto. oneofDecl. map {
691
- return featureResolver. resolve ( $0. options, resolvedParent: resolvedFeatures)
691
+ featureResolver. resolve ( $0. options, resolvedParent: resolvedFeatures)
692
692
}
693
693
694
694
self . messageExtensionRanges = proto. extensionRange. enumerated ( ) . map {
@@ -759,12 +759,12 @@ public final class Descriptor {
759
759
fileprivate func bind( file: FileDescriptor , registry: Registry , containingType: Descriptor ? ) {
760
760
_file = file
761
761
self . containingType = containingType
762
- messageExtensionRanges. forEach { $0 . bind ( containingType: self , registry: registry) }
763
- enums. forEach { $0 . bind ( file: file, registry: registry, containingType: self ) }
764
- messages. forEach { $0 . bind ( file: file, registry: registry, containingType: self ) }
765
- fields. forEach { $0 . bind ( file: file, registry: registry, containingType: self ) }
766
- oneofs. forEach { $0 . bind ( registry: registry, containingType: self ) }
767
- extensions. forEach { $0 . bind ( file: file, registry: registry, containingType: self ) }
762
+ for e in messageExtensionRanges { e . bind ( containingType: self , registry: registry) }
763
+ for e in enums { e . bind ( file: file, registry: registry, containingType: self ) }
764
+ for m in messages { m . bind ( file: file, registry: registry, containingType: self ) }
765
+ for f in fields { f . bind ( file: file, registry: registry, containingType: self ) }
766
+ for o in oneofs { o . bind ( registry: registry, containingType: self ) }
767
+ for e in extensions { e . bind ( file: file, registry: registry, containingType: self ) }
768
768
769
769
// Synthetic oneofs come after normal oneofs. The C++ Descriptor enforces this, only
770
770
// here as a secondary validation because other code can rely on it.
@@ -878,7 +878,7 @@ public final class EnumDescriptor {
878
878
// Done initializing, register ourselves.
879
879
registry. register ( enum: self )
880
880
881
- values. forEach { $0 . bind ( enumType: self ) }
881
+ for v in values { v . bind ( enumType: self ) }
882
882
}
883
883
884
884
fileprivate func bind( file: FileDescriptor , registry: Registry , containingType: Descriptor ? ) {
@@ -1461,7 +1461,7 @@ public final class ServiceDescriptor {
1461
1461
1462
1462
fileprivate func bind( file: FileDescriptor , registry: Registry ) {
1463
1463
_file = file
1464
- methods. forEach { $0 . bind ( service: self , registry: registry) }
1464
+ for m in methods { m . bind ( service: self , registry: registry) }
1465
1465
}
1466
1466
}
1467
1467
0 commit comments