Skip to content

Commit 096150a

Browse files
committed
[gardening] Strip trailing whitespace
1 parent 6f25962 commit 096150a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: benchmark/single-source/CSVParsing.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ let quote = "\"".utf16.first!
1515

1616
func parseQuotedField(_ remainder: inout Substring) throws -> Substring? {
1717
var result: Substring = "" // we accumulate the result
18-
18+
1919
while !remainder.isEmpty {
2020
guard let nextQuoteIndex = remainder.index(of: "\"") else {
2121
throw ParseError(message: "Expected a closing \"")
2222
}
23-
23+
2424
// Append until the next quote
2525
result += remainder.prefix(upTo: nextQuoteIndex)
2626
remainder.remove(upToAndIncluding: nextQuoteIndex)
27-
27+
2828
if let peek = remainder.utf16.first {
2929
switch peek {
3030
case quote: // two quotes after each other is an escaped quote
@@ -41,7 +41,7 @@ func parseQuotedField(_ remainder: inout Substring) throws -> Substring? {
4141
return result
4242
}
4343
}
44-
44+
4545
throw ParseError(message: "Expected a closing quote")
4646
}
4747

@@ -80,7 +80,7 @@ extension Substring {
8080
mutating func remove(upTo index: Index) {
8181
self = suffix(from: index)
8282
}
83-
83+
8484
mutating func remove(upToAndIncluding index: Index) {
8585
self = suffix(from: self.index(after: index))
8686
}
@@ -133,10 +133,10 @@ public func run_CSVParsing(_ N: Int) {
133133

134134
for _ in 0..<N {
135135
var remainder = contents[...]
136-
136+
137137
var result: Int = 0
138138
var x: () = ()
139-
139+
140140
while !remainder.isEmpty {
141141
blackHole(try? parseLine(&remainder, result: &x, processField: { state, _, field in
142142
()

0 commit comments

Comments
 (0)