Skip to content

Conversation

@reallesee
Copy link
Contributor

upperBound returns first index with value > element. Comment incorrectly stated "strictly less than" for the no-match case — should be "less than or equal to".

@reallesee reallesee requested a review from a team as a code owner December 16, 2025 06:30
@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2025

⚠️ No Changeset found

Latest commit: 2e01123

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

The pull request updates documentation in the upperBound function within the Arrays utility contract. The docstring is clarified to accurately describe the boundary condition for when no matching index exists, specifying that this corresponds to all array values being less than or equal to the given element. The underlying implementation logic remains unchanged, as the function continues to return the first index of a value strictly greater than the provided element.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing an incorrect comment in the Arrays.sol upperBound function.
Description check ✅ Passed The description clearly explains the correction being made: the comment incorrectly stated 'strictly less than' but should state 'less than or equal to' for the no-match case.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 353f564 and ad44c70.

📒 Files selected for processing (1)
  • contracts/utils/Arrays.sol (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Redirect rules - solidity-contracts
  • GitHub Check: Header rules - solidity-contracts
  • GitHub Check: Pages changed - solidity-contracts
  • GitHub Check: tests-upgradeable
  • GitHub Check: slither
  • GitHub Check: tests
  • GitHub Check: tests-foundry
  • GitHub Check: coverage
  • GitHub Check: halmos
🔇 Additional comments (1)
contracts/utils/Arrays.sol (1)

286-293: LGTM! Documentation correction is accurate.

The updated comment correctly describes the boundary condition. When upperBound returns array.length, it means no value in the array is strictly greater than element, which indeed corresponds to all values being less than or equal to element. This aligns with the implementation logic and the C++ std::upper_bound semantics referenced in the documentation.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Amxx Amxx changed the base branch from master to typo-fixes December 19, 2025 15:47
@Amxx Amxx added this to the typo-fixes milestone Dec 19, 2025
@Amxx
Copy link
Collaborator

Amxx commented Dec 19, 2025

This is a procedurally generated file, we need to change the template accordingly.

@reallesee
Copy link
Contributor Author

Done, updated

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants