Closed jasonmedeiros closed 2 years ago
Thanks for bringing this up. Implemented a fix with tests for the Parser.
We've invited you to join the SwiftCSV GitHub organization – no pressure to accept! If you'd like more information on what that means, check out our contributor guidelines.
Otherwise, things like CSV.init(string: String, delimiter: Character = comma, loadColumns: Bool = true) will parse the whole string when just trying to get the headers.
For large inputs, this was noticeable wasted work.
I think this was an oversight, but it does break the test
testThrowsOnInvalidData
. I think that test is of dubious value and just kinda incidentally worked.