Skip to content

Commit

Permalink
small speedup to reduce mul
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Oct 8, 2024
1 parent 6412193 commit bb586f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/algorithm/reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ pub(crate) fn reduce_impl(f: Function, depth: usize, env: &mut Uiua) -> UiuaResu
fast_reduce_different(bytes, 0.0, fill, depth, sub::num_num, sub::num_byte)
.into()
}
Primitive::Mul if bytes.meta().flags.is_boolean() => {
let byte_fill = env.scalar_fill::<u8>().ok();
if bytes.row_count() == 0 || fill.is_some() && byte_fill.is_none() {
fast_reduce_different(bytes, 1.0, fill, depth, mul::num_num, mul::num_byte)
.into()
} else {
fast_reduce(bytes, 1, byte_fill, depth, mul::bool_bool).into()
}
}
Primitive::Mul => {
fast_reduce_different(bytes, 1.0, fill, depth, mul::num_num, mul::num_byte)
.into()
Expand Down

0 comments on commit bb586f8

Please sign in to comment.