Data-Liberation-Front / csvlint.rb

The gem behind http://csvlint.io
MIT License
283 stars 86 forks source link

Speed up #build_formats (changes its API) #103

Closed jpmckinney closed 9 years ago

jpmckinney commented 9 years ago

Rewrites build_formats for more speed.

  1. Stops once best match is found and skips tests that won't match
  2. Performs count directly instead of temporarily storing a value for every row
  3. Uses symbols to be nice to garbage collector

My understanding is that #build_formats is only used internally, i.e. not part of a public API.

Floppy commented 9 years ago

Hey there - we're not getting much time on csvlint at the moment, but I'll try to find time to review and merge this (and others) this week. Thanks for the contributions!

Floppy commented 9 years ago

I've pulled this into our own branch so I could bring it up to date with master; I'll merge it in a separate PR.