Skip to content

Commit

Permalink
Remove simplify_inner (#173)
Browse files Browse the repository at this point in the history
This doesn't appear to be used anywhere else, so we can inline it into
`simplify`
  • Loading branch information
mkeeter authored Nov 5, 2024
1 parent 36c8876 commit 0ca170e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
16 changes: 4 additions & 12 deletions fidget/src/core/vm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,6 @@ impl<const N: usize> From<VmData<N>> for GenericVmFunction<N> {
}

impl<const N: usize> GenericVmFunction<N> {
pub(crate) fn simplify_inner(
&self,
choices: &[Choice],
storage: VmData<N>,
workspace: &mut VmWorkspace<N>,
) -> Result<Self, Error> {
let d = self.0.simplify(choices, workspace, storage)?;
Ok(Self(Arc::new(d)))
}
/// Returns a characteristic size (the length of the inner assembly tape)
pub fn size(&self) -> usize {
self.0.len()
Expand Down Expand Up @@ -171,11 +162,12 @@ impl<const N: usize> Function for GenericVmFunction<N> {
type Trace = VmTrace;
fn simplify(
&self,
trace: &VmTrace,
storage: VmData<N>,
trace: &Self::Trace,
storage: Self::Storage,
workspace: &mut Self::Workspace,
) -> Result<Self, Error> {
self.simplify_inner(trace.as_slice(), storage, workspace)
let d = self.0.simplify(trace.as_slice(), workspace, storage)?;
Ok(Self(Arc::new(d)))
}

fn recycle(self) -> Option<Self::Storage> {
Expand Down
4 changes: 1 addition & 3 deletions fidget/src/jit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,7 @@ impl Function for JitFunction {
storage: Self::Storage,
workspace: &mut Self::Workspace,
) -> Result<Self, Error> {
self.0
.simplify_inner(trace.as_slice(), storage, workspace)
.map(JitFunction)
self.0.simplify(trace, storage, workspace).map(JitFunction)
}

fn recycle(self) -> Option<Self::Storage> {
Expand Down

0 comments on commit 0ca170e

Please sign in to comment.