Skip to content

Commit

Permalink
fix a bug in filled reshape
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Schmidt committed Jan 3, 2024
1 parent 080559d commit 1259296
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/algorithm/dyadic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ use crate::{
Shape, Uiua, UiuaResult,
};

#[cfg(feature = "bytes")]
use super::op_bytes_retry_fill;
use super::{ArrayCmpSlice, FillContext};

impl Value {
Expand Down Expand Up @@ -162,18 +160,14 @@ impl Value {
Value::Num(a) => a.reshape(&target_shape, env),
#[cfg(feature = "bytes")]
Value::Byte(a) => {
*self = op_bytes_retry_fill(
take(a),
|mut a| {
a.reshape(&target_shape, env)?;
Ok(a.into())
},
|mut a| {
a.reshape(&target_shape, env)?;
Ok(a.into())
},
)?;
Ok(())
if env.num_fill().is_ok() && env.byte_fill().is_err() {
let mut arr: Array<f64> = a.convert_ref();
arr.reshape(&target_shape, env)?;
*self = arr.into();
Ok(())
} else {
a.reshape(&target_shape, env)
}
}
Value::Complex(a) => a.reshape(&target_shape, env),
Value::Char(a) => a.reshape(&target_shape, env),
Expand Down

0 comments on commit 1259296

Please sign in to comment.