Skip to content

core/utils: add BoundedQueue methods, collection helpers, and fix Bat…#21198

Open
amussara wants to merge 1 commit intosmartcontractkit:developfrom
amussara:improve-utils-bounded-queue-and-collection
Open

core/utils: add BoundedQueue methods, collection helpers, and fix Bat…#21198
amussara wants to merge 1 commit intosmartcontractkit:developfrom
amussara:improve-utils-bounded-queue-and-collection

Conversation

@amussara
Copy link

…chSplit

  • Add Len, Peek, Clear, Cap methods to BoundedQueue for better introspection
  • Add Len method to BoundedPriorityQueue
  • Clamp non-positive capacity in NewBoundedQueue to 1 to prevent misuse
  • Fix BatchSplit to reject negative max values (was only checking zero)
  • Add generic collection helpers: Flatten, UniqueValues, MergeMaps, FilterSlice, MapSlice, ContainsDuplicate
  • Add comprehensive tests for all new functionality

Requires

Supports

…chSplit

- Add Len, Peek, Clear, Cap methods to BoundedQueue for better introspection
- Add Len method to BoundedPriorityQueue
- Clamp non-positive capacity in NewBoundedQueue to 1 to prevent misuse
- Fix BatchSplit to reject negative max values (was only checking zero)
- Add generic collection helpers: Flatten, UniqueValues, MergeMaps,
  FilterSlice, MapSlice, ContainsDuplicate
- Add comprehensive tests for all new functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments