Skip to content

Commit 6a3bff4

Browse files
author
Docs Syncer
committed
CI: 728b536
1 parent 4ab7492 commit 6a3bff4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/reference/contracts/libs/arrays/ArrayHelper.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,33 @@ Return values:
6565
| :----- | :------ | :----------------------------------------------------------------------------- |
6666
| index_ | uint256 | the index of the found element or the length of the `array` if no such element |
6767

68+
### contains
69+
70+
```solidity
71+
function contains(
72+
uint256[] storage array,
73+
uint256 element_
74+
) internal view returns (bool)
75+
```
76+
77+
The function that searches for the `element_` and returns whether it is present in the array.
78+
The time complexity is O(log n)
79+
80+
81+
Parameters:
82+
83+
| Name | Type | Description |
84+
| :------- | :-------- | :---------------------- |
85+
| array | uint256[] | the array to search in |
86+
| element_ | uint256 | the element |
87+
88+
89+
Return values:
90+
91+
| Name | Type | Description |
92+
| :--- | :--- | :--------------------------------------------- |
93+
| [0] | bool | whether the `element_` is present in the array |
94+
6895
### getRangeSum
6996

7097
```solidity

0 commit comments

Comments
 (0)