File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
docs/reference/contracts/libs/arrays Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,33 @@ Return values:
65
65
| :----- | :------ | :----------------------------------------------------------------------------- |
66
66
| index_ | uint256 | the index of the found element or the length of the ` array ` if no such element |
67
67
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
+
68
95
### getRangeSum
69
96
70
97
``` solidity
You can’t perform that action at this time.
0 commit comments