refactor(const_eval): inline math_pow

This commit is contained in:
Erich Gubler committed 2024-01-18 16:57:46 -05:00
1 parent c2f110ed0c
commit 063e11027b
1 file changed
+5 -10
+5 -10
View File
@@ -837,7 +837,11 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::Atanh => {
component_wise_float!(self, span, [arg], |e| { Ok([e.atanh()]) })
}
crate::MathFunction::Pow => self.math_pow(arg, arg1.unwrap(), span),
crate::MathFunction::Pow => {
component_wise_float!(self, span, [arg, arg1.unwrap()], |e1, e2| {
Ok([e1.powf(e2)])
})
}
crate::MathFunction::Clamp => {
component_wise_scalar!(
self,
@@ -913,15 +917,6 @@ impl<'a> ConstantEvaluator<'a> {
}
}
fn math_pow(
&mut self,
e1: Handle<Expression>,
e2: Handle<Expression>,
span: Span,
) -> Result<Handle<Expression>, ConstantEvaluatorError> {
component_wise_float!(self, span, [e1, e2], |e1, e2| { Ok([e1.powf(e2)]) })
}
fn array_length(
&mut self,
array: Handle<Expression>,