Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize parameter naming in ArrayHelper.sol #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions contracts/libs/arrays/ArrayHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ library ArrayHelper {

/**
* @notice The function to compute the prefix sum array
* @param arr_ the initial array to be turned into the prefix sum array
* @param array_ the initial array to be turned into the prefix sum array
* @return prefixes_ the prefix sum array
*/
function countPrefixes(
uint256[] memory arr_
uint256[] memory array_
) internal pure returns (uint256[] memory prefixes_) {
if (arr_.length == 0) {
if (array_.length == 0) {
return prefixes_;
}

prefixes_ = new uint256[](arr_.length);
prefixes_[0] = arr_[0];
prefixes_ = new uint256[](array_.length);
prefixes_[0] = array_[0];

for (uint256 i = 1; i < prefixes_.length; i++) {
prefixes_[i] = prefixes_[i - 1] + arr_[i];
prefixes_[i] = prefixes_[i - 1] + array_[i];
}
}

Expand Down