Skip to content

Conversation

bogdan
Copy link
Contributor

@bogdan bogdan commented Mar 6, 2012

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.

@mikel
Copy link
Owner

mikel commented Nov 17, 2012

Nice, thanks :)

@mikel mikel merged commit bced96d into mikel:master Nov 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants