Skip to content

Commit 958733c

Browse files
committed
[benchmark] False() → getFalse()
1 parent bd9a220 commit 958733c

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

benchmark/single-source/Ackermann.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func ackermann(_ M: Int, _ N : Int) -> Int {
2929
func Ackermann(_ M: Int, _ N : Int) -> Int {
3030
// This if prevents optimizer from computing return value of Ackermann(3,9)
3131
// at compile time.
32-
if False() { return 0 }
32+
if getFalse() { return 0 }
3333
if (M == 0) { return N + 1 }
3434
if (N == 0) { return ackermann(M - 1, 1) }
3535
return ackermann(M - 1, ackermann(M, N - 1))

benchmark/single-source/Fibonacci.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func fibonacci(_ n: Int) -> Int {
2626
func Fibonacci(_ n: Int) -> Int {
2727
// This if prevents optimizer from computing return value of Fibonacci(32)
2828
// at compile time.
29-
if False() { return 0 }
29+
if getFalse() { return 0 }
3030

3131
if (n <= 2) { return 1 }
3232
return fibonacci(n - 2) + fibonacci(n - 1)

benchmark/single-source/StaticArray.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ typealias SA128Int = StaticArray<A2X<A2X<A2X<A2X<A2X<A2X<A0<Int>>>>>>>>
8686

8787
// Make sure the optimizer does not optimize the compute away.
8888
@inline(never)
89-
public func sink(_ value: Int) { if False() { print(value) }}
89+
public func sink(_ value: Int) { if getFalse() { print(value) }}
9090

9191

9292
@inline(never)

benchmark/utils/TestsUtils.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ public func autoreleasepool<Result>(
307307
}
308308
#endif
309309

310+
public func getFalse() -> Bool { return false }
311+
312+
@available(*, deprecated, renamed: "getFalse()")
310313
public func False() -> Bool { return false }
311314

312315
/// This is a dummy protocol to test the speed of our protocol dispatch.

0 commit comments

Comments
 (0)