From 914dda17c98ec42becf0ccc4bda26532b915d8e2 Mon Sep 17 00:00:00 2001 From: Thomas Coratger Date: Sun, 22 Dec 2024 23:00:28 +0100 Subject: [PATCH] poly: refactor polynomial univariate dense evaluate --- poly/src/polynomial/univariate/dense.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/poly/src/polynomial/univariate/dense.rs b/poly/src/polynomial/univariate/dense.rs index 075351523..1f9007707 100644 --- a/poly/src/polynomial/univariate/dense.rs +++ b/poly/src/polynomial/univariate/dense.rs @@ -40,11 +40,12 @@ impl Polynomial for DensePolynomial { /// Evaluates `self` at the given `point` in `Self::Point`. fn evaluate(&self, point: &F) -> F { if self.is_zero() { - return F::zero(); + F::zero() } else if point.is_zero() { - return self.coeffs[0]; + self.coeffs[0] + } else { + self.internal_evaluate(point) } - self.internal_evaluate(point) } }