Skip to content

Commit 5d1af10

Browse files
[gardening] Use "{let,var} c: C" instead of "{let,var} c : C"
Inspired by @gribozavr:s fix in 1ad6667
1 parent 1ad6667 commit 5d1af10

32 files changed

+98
-98
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5050,15 +5050,15 @@ Swift 2.2
50505050
var x = Int8(-129)
50515051
// error: integer literal overflows when stored into 'Int8'
50525052

5053-
var y : Int = 0xFFFF_FFFF_FFFF_FFFF_F
5053+
var y: Int = 0xFFFF_FFFF_FFFF_FFFF_F
50545054
// error: integer literal overflows when stored into 'Int'
50555055
```
50565056

50575057
Overflows in constant integer expressions are also reported by the compiler.
50585058

50595059
```swift
5060-
var x : Int8 = 125
5061-
var y : Int8 = x + 125
5060+
var x: Int8 = 125
5061+
var y: Int8 = x + 125
50625062
// error: arithmetic operation '125 + 125' (on type 'Int8') results in
50635063
// an overflow
50645064
```

benchmark/single-source/ArrayOfGenericPOD.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// An integer enum takes two words.
2020

2121
class RefArray<T> {
22-
var array : [T]
22+
var array: [T]
2323

2424
init(_ i:T) {
2525
array = [T](repeating: i, count: 100000)
@@ -48,8 +48,8 @@ func genIOUArray() {
4848
// struct has multiple fields of trivial type. Destroying the
4949
// elements should be a nop.
5050
struct S<T> {
51-
var x : T
52-
var y : T
51+
var x: T
52+
var y: T
5353
}
5454
@inline(never)
5555
func genStructArray() {

benchmark/single-source/ArrayOfGenericRef.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protocol Constructible {
2020
init(e:Element)
2121
}
2222
class ConstructibleArray<T:Constructible> {
23-
var array : [T]
23+
var array: [T]
2424

2525
init(_ e:T.Element) {
2626
array = [T]()
@@ -33,7 +33,7 @@ class ConstructibleArray<T:Constructible> {
3333

3434
class GenericRef<T> : Constructible {
3535
typealias Element=T
36-
var x : T
36+
var x: T
3737
required init(e:T) { self.x = e }
3838
}
3939

@@ -56,7 +56,7 @@ func genCommonRefArray() {
5656

5757
// Reuse the same enum value for each element.
5858
class RefArray<T> {
59-
var array : [T]
59+
var array: [T]
6060

6161
init(_ i:T, count:Int = 10_000) {
6262
array = [T](repeating: i, count: count)
@@ -73,7 +73,7 @@ func genRefEnumArray() {
7373

7474
struct GenericVal<T> : Constructible {
7575
typealias Element=T
76-
var x : T
76+
var x: T
7777
init(e:T) { self.x = e }
7878
}
7979

benchmark/single-source/ArrayOfPOD.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func genEnumArray() {
4343
}
4444

4545
struct S {
46-
var x : Int
47-
var y : Int
46+
var x: Int
47+
var y: Int
4848
}
4949
@inline(never)
5050
func genStructArray() {

benchmark/single-source/ArrayOfRef.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ConstructibleArray<T:Constructible> {
3535
// Reference to a POD class.
3636
class POD : Constructible {
3737
typealias Element=Int
38-
var x : Int
38+
var x: Int
3939
required init(e:Int) { self.x = e }
4040
}
4141

@@ -50,7 +50,7 @@ class Dummy {}
5050
// Reference to a reference. The nested reference is shared across elements.
5151
class CommonRef : Constructible {
5252
typealias Element=Dummy
53-
var d : Dummy
53+
var d: Dummy
5454
required init(e:Dummy) { self.d = e }
5555
}
5656

@@ -85,7 +85,7 @@ func genRefEnumArray() {
8585
// Struct holding a reference.
8686
struct S : Constructible {
8787
typealias Element=Dummy
88-
var d : Dummy
88+
var d: Dummy
8989
init(e:Dummy) { self.d = e }
9090
}
9191

benchmark/single-source/BitCount.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import TestsUtils
1818

1919
func countBitSet(_ num: Int) -> Int {
2020
let bits = sizeof(Int.self) * 8
21-
var cnt : Int = 0
21+
var cnt: Int = 0
2222
var mask: Int = 1
2323
for _ in 0...bits {
2424
if num & mask != 0 {

benchmark/single-source/DictTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class Box<T : Hashable where T : Equatable> : Hashable {
153153
value = v
154154
}
155155

156-
var hashValue : Int {
156+
var hashValue: Int {
157157
return value.hashValue
158158
}
159159
}

benchmark/single-source/DictTest2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Box<T : Hashable where T : Equatable> : Hashable {
4444
value = v
4545
}
4646

47-
var hashValue : Int {
47+
var hashValue: Int {
4848
return value.hashValue
4949
}
5050
}

benchmark/single-source/DictTest3.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Box<T : Hashable where T : Equatable> : Hashable {
5151
value = v
5252
}
5353

54-
var hashValue : Int {
54+
var hashValue: Int {
5555
return value.hashValue
5656
}
5757
}

benchmark/single-source/DictionaryBridge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Thing : NSObject {
4545
}
4646

4747
class Stuff {
48-
var c : Thing = Thing.mk()
48+
var c: Thing = Thing.mk()
4949
init() {
5050

5151
}

0 commit comments

Comments
 (0)