Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct capacity when creating DynamicQueue when FixedQueue is full #6632

Merged

Conversation

ondravondra
Copy link
Contributor

Fixes #6631

Changes

When DynamicQueue is allocated, it's capacity is set to the original capacity of the buffer using it.

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -375,7 +375,7 @@ public void Enqueue(T element)
{
if (_tail - _head == Size)
{
var queue = new DynamicQueue(_head);
var queue = new DynamicQueue(Capacity);
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) April 4, 2023 12:31
@Aaronontheweb Aaronontheweb merged commit e052a78 into akkadotnet:dev Apr 4, 2023
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.

Queue with capacity = int.MaxValue and strategy DropNew still drops items after very small amount is added
2 participants