From e50d79a347bb7a9a816080e5f063d0c2c49e51c6 Mon Sep 17 00:00:00 2001 From: Jakub Nabaglo Date: Wed, 8 Sep 2021 16:04:31 -0700 Subject: [PATCH] Tweaks to CrandallField::product --- src/field/crandall_field.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/field/crandall_field.rs b/src/field/crandall_field.rs index fa63fcb6..8690f8ff 100644 --- a/src/field/crandall_field.rs +++ b/src/field/crandall_field.rs @@ -431,8 +431,9 @@ impl MulAssign for CrandallField { } impl Product for CrandallField { + #[inline] fn product>(iter: I) -> Self { - iter.fold(Self::ONE, |acc, x| acc * x) + iter.reduce(|acc, x| acc * x).unwrap_or(Self::ONE) } }