Skip to content

Commit 782ee20

Browse files
authored
Further optimisation with guard
1 parent 8b997b4 commit 782ee20

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

benchmark/utils/DriverUtils.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,10 @@ struct TestConfig {
208208
}
209209

210210
if let x = benchArgs.optionalArgsMap["--sleep"] {
211-
let v: Int? = Int(x)
212-
if v == nil {
211+
guard let v = Int(x) else {
213212
return .fail("--sleep requires a non-empty integer value")
214213
}
215-
afterRunSleep = v!
214+
afterRunSleep = v
216215
}
217216

218217
if let _ = benchArgs.optionalArgsMap["--list"] {

0 commit comments

Comments
 (0)