bor icon indicating copy to clipboard operation
bor copied to clipboard

refactor: use the built-in max/min to simplify the code

Open findmyhappy opened this issue 7 months ago • 1 comments

Description

In Go 1.21, the standard library includes built-in max/min function, which can greatly simplify the code.

Changes

  • [ ] Bugfix (non-breaking change that solves an issue)
  • [ ] Hotfix (change that solves an urgent issue, and requires immediate attention)
  • [x] New feature (non-breaking change that adds functionality)
  • [ ] Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • [ ] Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • [ ] I have added at least 2 reviewer or the whole pos-v1 team
  • [ ] I have added sufficient documentation in code
  • [ ] I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • [ ] Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • [ ] Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • [ ] This PR requires changes to heimdall
    • In case link the PR here:
  • [ ] This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • [ ] I have added unit tests
  • [ ] I have added tests to CI
  • [ ] I have tested this code manually on local environment
  • [ ] I have tested this code manually on remote devnet using express-cli
  • [ ] I have tested this code manually on amoy
  • [ ] I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

findmyhappy avatar Jun 04 '25 05:06 findmyhappy

This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Jun 26 '25 00:06 github-actions[bot]

This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

friendly ping

findmyhappy avatar Jul 04 '25 14:07 findmyhappy

This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

friendly ping

Hey, I guess this is useful, but as this is a fork of geth, making changes here would cause merge conflicts when doing the next upstream merge. Not much worth it, if geth includes these changes, we'll get them anyway.

kamuikatsurgi avatar Jul 04 '25 16:07 kamuikatsurgi

This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Jul 26 '25 00:07 github-actions[bot]

This PR was closed because it has been stalled for 35 days with no activity.

github-actions[bot] avatar Aug 10 '25 00:08 github-actions[bot]