If only one filter selected use it for evaluations #582
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The filters used during reduction evaluations are normally set to None & Bigrams, regardless of any options. This PR makes a slight change so that if only one filter is specified in the options, this filter will be used for reduction evaluations too.
This resolves an odd situation affecting lower levels (when --fast is enabled) where you may try to force the filter to a specific value but it actually ends up different because a reduction evaluation was smaller. It's particularly helpful if you're wanting it to be as fast as possible by using
-o0 -f0
which will now exclusively use None instead of trying the slower Bigrams as well.As another use, you could try to brute force oxipng by iterating each filter separately, though this may not actually achieve anything 馃槀
[edit] I also pulled the options out into a separate file, though this wasn't relevant to the filter change.