Omniscia 0xPhase Audit

BalancerCalculationsFacet Code Style Findings

BalancerCalculationsFacet Code Style Findings

BCF-01C: Redundant Default Value Assignments

TypeSeverityLocation
Gas OptimizationBalancerCalculationsFacet.sol:L71-L72

Description:

The referenced assignments are redundant as they perform an assignment to variables that already possess those values.

Example:

balancer/diamond/BalancerCalculationsFacet.sol
69for (uint256 i = 0; i < infoLength; ) {
70 if (!infos[i].state) {
71 arr[i].isPositive = false;
72 arr[i].offset = 0;
73
74 unchecked {
75 i++;
76 }
77
78 continue;
79 }

Recommendation:

We advise the code to not perform these assignments, optimizing its execution cost.

Alleviation:

The redundant zero-value assignments are no longer performed by the codebase rendering it optimal.

BCF-02C: Redundant Parenthesis Statement

TypeSeverityLocation
Code StyleBalancerCalculationsFacet.sol:L160

Description:

The referenced statement is redundantly wrapped in parenthesis (()).

Example:

balancer/diamond/BalancerCalculationsFacet.sol
160if ((_getTime() - info.start) < BalancerConstants.APR_MIN_TIME) {

Recommendation:

We advise them to be safely omitted, increasing the legibility of the codebase.

Alleviation:

The redundant parenthesis statement has been safely removed from the codebase as advised.