Skip to content

Commit

Permalink
CI: 728b536
Browse files Browse the repository at this point in the history
  • Loading branch information
Docs Syncer committed Jul 17, 2024
1 parent 4ab7492 commit 6a3bff4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/reference/contracts/libs/arrays/ArrayHelper.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,33 @@ Return values:
| :----- | :------ | :----------------------------------------------------------------------------- |
| index_ | uint256 | the index of the found element or the length of the `array` if no such element |

### contains

```solidity
function contains(
uint256[] storage array,
uint256 element_
) internal view returns (bool)
```

The function that searches for the `element_` and returns whether it is present in the array.
The time complexity is O(log n)


Parameters:

| Name | Type | Description |
| :------- | :-------- | :---------------------- |
| array | uint256[] | the array to search in |
| element_ | uint256 | the element |


Return values:

| Name | Type | Description |
| :--- | :--- | :--------------------------------------------- |
| [0] | bool | whether the `element_` is present in the array |

### getRangeSum

```solidity
Expand Down

0 comments on commit 6a3bff4

Please sign in to comment.