From 6a3bff4b99a081be01b952771426528fcf988040 Mon Sep 17 00:00:00 2001 From: Docs Syncer Date: Wed, 17 Jul 2024 14:38:05 +0000 Subject: [PATCH] CI: `728b536` --- .../contracts/libs/arrays/ArrayHelper.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/reference/contracts/libs/arrays/ArrayHelper.md b/docs/reference/contracts/libs/arrays/ArrayHelper.md index 5cc5267..48028ab 100644 --- a/docs/reference/contracts/libs/arrays/ArrayHelper.md +++ b/docs/reference/contracts/libs/arrays/ArrayHelper.md @@ -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