Allow disabling all alpha optimizations (#181)
Fixes a bug where oxipng would crash if alpha optimizations were all disabled.
This commit is contained in:
parent
9408a50b1b
commit
4cb26d462e
1 changed files with 4 additions and 1 deletions
|
|
@ -16,7 +16,10 @@ pub(crate) fn try_alpha_reductions(
|
|||
alphas: &HashSet<AlphaOptim>,
|
||||
eval: &Evaluator,
|
||||
) {
|
||||
assert!(!alphas.is_empty());
|
||||
if alphas.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
let alphas = alphas.iter().collect::<Vec<_>>();
|
||||
let alphas_iter = alphas.par_iter().with_max_len(1);
|
||||
alphas_iter
|
||||
|
|
|
|||
Loading…
Reference in a new issue