Skip to content

Conversation

@ggq89
Copy link
Contributor

@ggq89 ggq89 commented Mar 29, 2025

Description

This PR mainly annotates IsLess and IsLessEq of BoundedComparator and adds test cases to prevent misuse.

Type of change

  • This change requires a documentation update

How has this been tested?

  • TestBoundedComparator

How has this been benchmarked?

  • Benchmark A, on Macbook pro M1, 32GB RAM
  • Benchmark B, on x86 Intel xxx, 16GB RAM

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ggq89
Copy link
Contributor Author

ggq89 commented Mar 29, 2025

In general, it is recommended that BoundedComparator do not provide the IsLess and IsLessEq methods to the outside world. First, they are easy to misuse, and second, there are alternative methods in generic.

@ivokub ivokub added the src: community Community originating PRs and issues label Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

src: community Community originating PRs and issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants