Skip to content

Commit 3aa0396

Browse files
committed
[benchmark] Use String.split instead of String.components.
This allows the benchmarks to be built without the Foundation overlay being built. I am currently prototyping having +0 parameters for all normal arguments and have not gotten the Foundation overlay to work yet... so this commit will let me get some initial numbers for the subset of the tests that do not depend on Foundation. rdar://34222540
1 parent 7ffb1a4 commit 3aa0396

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

benchmark/utils/ArgParse.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ public func parseArgs(_ validOptions: [String]? = nil)
5555
continue
5656
}
5757
// Attempt to split it into two components separated by an equals sign.
58-
let components = arg.components(separatedBy: "=")
59-
let optionName = components[0]
58+
let components = arg.split(separator: "=")
59+
let optionName = String(components[0])
6060
if validOptions != nil && !validOptions!.contains(optionName) {
6161
print("Invalid option: \(arg)")
6262
return nil
6363
}
6464
var optionVal : String
6565
switch components.count {
6666
case 1: optionVal = ""
67-
case 2: optionVal = components[1]
67+
case 2: optionVal = String(components[1])
6868
default:
6969
// If we do not have two components at this point, we can not have
7070
// an option switch. This is an invalid argument. Bail!

0 commit comments

Comments
 (0)