Skip to content

Commit b630380

Browse files
Gumichocopengin8lorentey
authored andcommitted
switch var to let in benchmark directory (swiftlang#24011)
* switch var to let in benchmark directory * Revert "switch var to let in benchmark directory" This reverts commit 6133471. * change gyb files to fix error
1 parent 5e7f06d commit b630380

21 files changed

+34
-34
lines changed

benchmark/single-source/AngryPhonebook.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public let AngryPhonebook = BenchmarkInfo(
2121
tags: [.validation, .api, .String],
2222
legacyFactor: 7)
2323

24-
var words = [
24+
let words = [
2525
"James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph",
2626
"Charles", "Thomas", "Christopher", "Daniel", "Matthew", "Donald", "Anthony",
2727
"Paul", "Mark", "George", "Steven", "Kenneth", "Andrew", "Edward", "Brian",

benchmark/single-source/AnyHashableWithAClass.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import TestsUtils
2222
// 11% _swift_stdlib_makeAnyHashableUpcastingToHashableBaseType
2323
// 16% _swift_retain_[n]
2424
// 5% swift_conformsToProtocol
25-
public var AnyHashableWithAClass = BenchmarkInfo(
25+
public let AnyHashableWithAClass = BenchmarkInfo(
2626
name: "AnyHashableWithAClass",
2727
runFunction: run_AnyHashableWithAClass,
2828
tags: [.abstraction, .runtime, .cpubench],

benchmark/single-source/ArrayOfGenericPOD.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public func run_ArrayOfGenericPOD(_ N: Int) {
7676

7777
// --- ArrayInitFromSlice
7878

79-
var globalArray = Array<UInt8>(repeating: 0, count: 4096)
79+
let globalArray = Array<UInt8>(repeating: 0, count: 4096)
8080

8181
func createArrayOfPOD() {
8282
blackHole(globalArray)

benchmark/single-source/ArraySetElement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import TestsUtils
1515
// 33% isUniquelyReferenced
1616
// 15% swift_rt_swift_isUniquelyReferencedOrPinned_nonNull_native
1717
// 18% swift_isUniquelyReferencedOrPinned_nonNull_native
18-
public var ArraySetElement = BenchmarkInfo(
18+
public let ArraySetElement = BenchmarkInfo(
1919
name: "ArraySetElement",
2020
runFunction: run_ArraySetElement,
2121
tags: [.runtime, .cpubench]

benchmark/single-source/ChainedFilterMap.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import TestsUtils
22

3-
public var ChainedFilterMap = [
3+
public let ChainedFilterMap = [
44
BenchmarkInfo(name: "ChainedFilterMap", runFunction: run_ChainedFilterMap,
55
tags: [.algorithm], setUpFunction: { blackHole(first100k) },
66
legacyFactor: 9),

benchmark/single-source/Chars.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public let Chars = BenchmarkInfo(
2020
setUpFunction: { blackHole(alphabetInput) },
2121
legacyFactor: 50)
2222

23-
var alphabetInput: [Character] = [
23+
let alphabetInput: [Character] = [
2424
"A", "B", "C", "D", "E", "F", "G",
2525
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
2626
"S", "T", "U",

benchmark/single-source/Hash.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Hash {
127127
final
128128
class MD5 : Hash {
129129
// Integer part of the sines of integers (in radians) * 2^32.
130-
var k : [UInt32] = [0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ,
130+
let k : [UInt32] = [0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ,
131131
0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 ,
132132
0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be ,
133133
0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 ,
@@ -145,7 +145,7 @@ class MD5 : Hash {
145145
0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 ]
146146

147147
// Per-round shift amounts
148-
var r : [UInt32] = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
148+
let r : [UInt32] = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
149149
5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
150150
4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
151151
6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]
@@ -433,7 +433,7 @@ class SHA256 : Hash {
433433
var h6: UInt32 = 0
434434
var h7: UInt32 = 0
435435

436-
var k : [UInt32] = [
436+
let k : [UInt32] = [
437437
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
438438
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
439439
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,

benchmark/single-source/LuhnAlgoEager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import TestsUtils
77

8-
public var LuhnAlgoEager = BenchmarkInfo(
8+
public let LuhnAlgoEager = BenchmarkInfo(
99
name: "LuhnAlgoEager",
1010
runFunction: run_LuhnAlgoEager,
1111
tags: [.algorithm]

benchmark/single-source/LuhnAlgoLazy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import TestsUtils
77

8-
public var LuhnAlgoLazy = BenchmarkInfo(
8+
public let LuhnAlgoLazy = BenchmarkInfo(
99
name: "LuhnAlgoLazy",
1010
runFunction: run_LuhnAlgoLazy,
1111
tags: [.algorithm]

benchmark/single-source/NibbleSort.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import TestsUtils
66

7-
public var NibbleSort = BenchmarkInfo(
7+
public let NibbleSort = BenchmarkInfo(
88
name: "NibbleSort",
99
runFunction: run_NibbleSort,
1010
tags: [.validation],

0 commit comments

Comments
 (0)