Skip to content

Conversation

@Amxx
Copy link
Collaborator

@Amxx Amxx commented Jan 18, 2024

This PR does the following:

  • Deprecate Array.findUpperBound which does not match the "upper bound" function in other standard libraries
  • Add Array.lowerBound and Array.upperBound that perform lower and upper bound lookup in storage arrays (with support for duplicates).
  • Add Array.lowerBoundMemory and Array.upperBoundMemory that perform lower and upper bound lookup in memory arrays (with support for duplicates).

Fixes #4744
Fixes LIB-1182
Fixes LIB-1188

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@changeset-bot
Copy link

changeset-bot bot commented Jan 18, 2024

🦋 Changeset detected

Latest commit: 7c9f21b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Amxx Amxx added the feature New contracts, functions, or helpers. label Jan 18, 2024
@Amxx Amxx added this to the 5.1 milestone Jan 18, 2024
@Amxx Amxx requested a review from ernestognw January 18, 2024 15:30
@Amxx Amxx mentioned this pull request Jan 29, 2024
3 tasks
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will continue reviewing

Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New contracts, functions, or helpers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a findLowerBound function to the Arrays library

3 participants