Among other tiny changes this PR contains the following optimization:
- 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.
Headers parsing performance optimization
Nice, thanks :)