mikel/mail — pull request #366 by bogdan (2012-03-06 14:22:55+00:00)
Title: Headers parsing performance optimization

Among other tiny changes this PR contains the following optimization:

``` diff
- selected = select_field_for(field.name)
-
- if selected.any? && limited_field?(field.name)
+ if limited_field?(field.name) && (selected = select_field_for(field.name)) && selected.any?
```

This allows `select_field_for`(that is pretty slow when number of headers is high) be called only when `limited_field?` returns true.

About 30% performance improvement for `Mail::Header.new` method when there are a lot of unknown headers.