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

Fix infinity loop when max_size is zero #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

defacedvr
Copy link

Max_size should be non_neg_integer
Explicitly handle max_size=0 and do nothing but return same struct

Max_size should be non_neg_integer
Explicitly handle max_size=0 and do nothing but return same struct
@defacedvr
Copy link
Author

Hi. What you think about such changes? I found it pretty usable some times to create deque with max_size=0 and use as bounded queue without worries.
When size depend on configuration, you will be able to simply provide 0 and use it like /dev/null.

Anyway, currently it goes to infinity loop, when max_size <= 0

@jhgg
Copy link

jhgg commented Jun 21, 2019

Can you update tests?

@defacedvr
Copy link
Author

Sure. I'll add some tests a little bit later

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.

2 participants