UIntArrayUtils
library UIntArrayUtils
Source: array-utils/UIntArrayUtils.sol
Reference
Functions
argFilter
function argFilter(uint256[] A, function (uint256) pure returns (bool) predicate) internal pure returns (uint256[])
- Parameters:
A
- uint256[]predicate
- function (uint256) pure returns (bool)- Returns:
- uint256[]
argGet
function argGet(uint256[] A, uint256[] indexArray) internal pure returns (uint256[])
- Parameters:
A
- uint256[]indexArray
- uint256[]- Returns:
- uint256[]
eq
function eq(uint256[] A, uint256[] B) internal pure returns (bool)
- Parameters:
A
- uint256[]B
- uint256[]- Returns:
- bool
equal
function equal(uint256[] A, uint256[] B) internal pure returns (bool)
- Parameters:
A
- uint256[]B
- uint256[]- Returns:
- bool
filter
function filter(uint256[] A, function (uint256) pure returns (bool) predicate) internal pure returns (uint256[])
Looks through each value in the list, returning an array of all the values that pass a truth test (predicate).
- Parameters:
A
- uint256[]predicate
- function (uint256) pure returns (bool)- Returns:
- uint256[]
indexOf
function indexOf(uint256[] A, uint256 a) internal returns (uint256, bool)
- Parameters:
A
- uint256[]a
- uint256- Returns:
- Returns index and isIn for the first occurrence starting from index 0
isEqual
function isEqual(uint256[] A, uint256[] B) internal pure returns (bool)
- Parameters:
A
- uint256[]B
- uint256[]- Returns:
- bool
map
function map(uint256[] A, function (uint256) pure returns (uint256) fn) internal pure returns (uint256[])
- Parameters:
A
- uint256[]fn
- function (uint256) pure returns (uint256)- Returns:
- uint256[]
reduce
function reduce(uint256[] A, function (uint256,uint256) pure returns (uint256) fn) internal pure returns (uint256)
- Parameters:
A
- uint256[]fn
- function (uint256,uint256) pure returns (uint256)- Returns:
- uint256
sPop
function sPop(uint256[] A, uint256 index) internal returns (uint256)
- Parameters:
A
- uint256[]index
- uint256- Returns:
- uint256
sPopCheap
function sPopCheap(uint256[] A, uint256 index) internal returns (uint256)
- Parameters:
A
- uint256[]index
- uint256- Returns:
- uint256