Skip to content

Commit 7d427aa

Browse files
authored
Merge pull request #6569 from mekjaer/mk-inconsistent-spacing-on-properties-and-arguments
[gardening] spacing on properties and arguments in IndexSet (stdlib)
2 parents 8ae2386 + 272dfb2 commit 7d427aa

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

stdlib/public/SDK/Foundation/IndexSet.swift

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
9898
/// then calling `next()` on this view's iterator will produce 3 ranges before returning nil.
9999
public struct RangeView : Equatable, BidirectionalCollection {
100100
public typealias Index = Int
101-
public let startIndex : Index
102-
public let endIndex : Index
101+
public let startIndex: Index
102+
public let endIndex: Index
103103

104-
fileprivate var indexSet : IndexSet
104+
fileprivate var indexSet: IndexSet
105105

106106
// Range of element values
107107
private var intersectingRange : Range<IndexSet.Element>?
@@ -170,10 +170,10 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
170170

171171
/// The mechanism for accessing the integers stored in an IndexSet.
172172
public struct Index : CustomStringConvertible, Comparable {
173-
fileprivate var value : IndexSet.Element
174-
fileprivate var extent : Range<IndexSet.Element>
175-
fileprivate var rangeIndex : Int
176-
fileprivate let rangeCount : Int
173+
fileprivate var value: IndexSet.Element
174+
fileprivate var extent: Range<IndexSet.Element>
175+
fileprivate var rangeIndex: Int
176+
fileprivate let rangeCount: Int
177177

178178
fileprivate init(value: Int, extent: Range<Int>, rangeIndex: Int, rangeCount: Int) {
179179
self.value = value
@@ -214,7 +214,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
214214
_handle = _MutablePairHandle(NSIndexSet(), copying: false)
215215
}
216216

217-
public var hashValue : Int {
217+
public var hashValue: Int {
218218
return _handle.map { $0.hash }
219219
}
220220

@@ -230,7 +230,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
230230
/// Returns a `Range`-based view of the entire contents of `self`.
231231
///
232232
/// - seealso: rangeView(of:)
233-
public var rangeView : RangeView {
233+
public var rangeView: RangeView {
234234
return RangeView(indexSet: self, intersecting: nil)
235235
}
236236

@@ -268,8 +268,8 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
268268

269269
private func _range(at index: RangeView.Index) -> Range<Element> {
270270
return _handle.map {
271-
var location : UInt = 0
272-
var length : UInt = 0
271+
var location: UInt = 0
272+
var length: UInt = 0
273273
__NSIndexSetRangeAtIndex($0, UInt(index), &location, &length)
274274
return Int(location)..<Int(location)+Int(length)
275275
}
@@ -290,8 +290,8 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
290290
public var endIndex: Index {
291291
let rangeCount = _rangeCount
292292
let rangeIndex = rangeCount - 1
293-
let extent : Range<Int>
294-
let value : Int
293+
let extent: Range<Int>
294+
let value: Int
295295
if rangeCount > 0 {
296296
extent = _range(at: rangeCount - 1)
297297
value = extent.upperBound // "1 past the end" position is the last range, 1 + the end of that range's extent
@@ -683,7 +683,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
683683
public func filteredIndexSet(in range : Range<Element>, includeInteger: (Element) throws -> Bool) rethrows -> IndexSet {
684684
let r : NSRange = _toNSRange(range)
685685
return try _handle.map {
686-
var error : Error?
686+
var error: Error?
687687
let result = $0.indexes(in: r, options: [], passingTest: { (i, stop) -> Bool in
688688
do {
689689
let include = try includeInteger(i)
@@ -794,14 +794,14 @@ extension IndexSet : CustomStringConvertible, CustomDebugStringConvertible, Cust
794794
private struct IndexSetBoundaryIterator : IteratorProtocol {
795795
typealias Element = IndexSet.Element
796796

797-
private var i1 : IndexSet.RangeView.Iterator
798-
private var i2 : IndexSet.RangeView.Iterator
799-
private var i1Range : CountableRange<Element>?
800-
private var i2Range : CountableRange<Element>?
801-
private var i1UsedLower : Bool
802-
private var i2UsedLower : Bool
797+
private var i1: IndexSet.RangeView.Iterator
798+
private var i2: IndexSet.RangeView.Iterator
799+
private var i1Range: CountableRange<Element>?
800+
private var i2Range: CountableRange<Element>?
801+
private var i1UsedLower: Bool
802+
private var i2UsedLower: Bool
803803

804-
fileprivate init(_ is1 : IndexSet, _ is2 : IndexSet) {
804+
fileprivate init(_ is1: IndexSet, _ is2: IndexSet) {
805805
i1 = is1.rangeView.makeIterator()
806806
i2 = is2.rangeView.makeIterator()
807807

@@ -818,21 +818,21 @@ private struct IndexSetBoundaryIterator : IteratorProtocol {
818818
return nil
819819
}
820820

821-
let nextIn1 : Element
821+
let nextIn1: Element
822822
if let r = i1Range {
823823
nextIn1 = i1UsedLower ? r.upperBound : r.lowerBound
824824
} else {
825825
nextIn1 = Int.max
826826
}
827827

828-
let nextIn2 : Element
828+
let nextIn2: Element
829829
if let r = i2Range {
830830
nextIn2 = i2UsedLower ? r.upperBound : r.lowerBound
831831
} else {
832832
nextIn2 = Int.max
833833
}
834834

835-
var result : Element
835+
var result: Element
836836
if nextIn1 <= nextIn2 {
837837
// 1 has the next element, or they are the same.
838838
result = nextIn1
@@ -860,7 +860,7 @@ extension IndexSet {
860860
}
861861
}
862862

863-
private func _toNSRange(_ r : Range<IndexSet.Element>) -> NSRange {
863+
private func _toNSRange(_ r: Range<IndexSet.Element>) -> NSRange {
864864
return NSMakeRange(r.lowerBound, r.upperBound - r.lowerBound)
865865
}
866866

@@ -928,7 +928,7 @@ private final class _MutablePairHandle<ImmutableType : NSObject, MutableType : N
928928
///
929929
/// - parameter immutable: The thing to stash.
930930
/// - parameter copying: Should be true unless you just created the instance (or called copy) and want to transfer ownership to this handle.
931-
init(_ immutable : ImmutableType, copying : Bool = true) {
931+
init(_ immutable: ImmutableType, copying: Bool = true) {
932932
if copying {
933933
self._pointer = _MutablePair.Default(immutable.copy() as! ImmutableType)
934934
} else {
@@ -940,7 +940,7 @@ private final class _MutablePairHandle<ImmutableType : NSObject, MutableType : N
940940
///
941941
/// - parameter mutable: The thing to stash.
942942
/// - parameter copying: Should be true unless you just created the instance (or called copy) and want to transfer ownership to this handle.
943-
init(_ mutable : MutableType, copying : Bool = true) {
943+
init(_ mutable: MutableType, copying: Bool = true) {
944944
if copying {
945945
self._pointer = _MutablePair.Mutable(mutable.mutableCopy() as! MutableType)
946946
} else {
@@ -950,7 +950,7 @@ private final class _MutablePairHandle<ImmutableType : NSObject, MutableType : N
950950

951951
/// Apply a closure to the reference type, regardless if it is mutable or immutable.
952952
@inline(__always)
953-
func map<ReturnType>(_ whatToDo : (ImmutableType) throws -> ReturnType) rethrows -> ReturnType {
953+
func map<ReturnType>(_ whatToDo: (ImmutableType) throws -> ReturnType) rethrows -> ReturnType {
954954
switch _pointer {
955955
case .Default(let i):
956956
return try whatToDo(i)
@@ -960,7 +960,7 @@ private final class _MutablePairHandle<ImmutableType : NSObject, MutableType : N
960960
}
961961
}
962962

963-
var reference : ImmutableType {
963+
var reference: ImmutableType {
964964
switch _pointer {
965965
case .Default(let i):
966966
return i

0 commit comments

Comments
 (0)