Summary: The function evaluateLagrangeOne computes the first Lagrange polynomial evaluation. However, this evaluation is also calculated as an intermediate result in the function evaluatePiPoly.
Suggestion: We recommend removing the evaluateLagrangeOne function and modifying evaluatePiPoly to return both the first Lagrange polynomial evaluation and the public input polynomial evaluation. This change would optimize gas usage and reduce code complexity.
Affected Code: PolynomialEval.sol (line 115)
Summary: The function evaluateLagrangeOne computes the first Lagrange polynomial evaluation. However, this evaluation is also calculated as an intermediate result in the function
evaluatePiPoly
.Suggestion: We recommend removing the
evaluateLagrangeOne
function and modifyingevaluatePiPoly
to return both the first Lagrange polynomial evaluation and the public input polynomial evaluation. This change would optimize gas usage and reduce code complexity.