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

Bug in example code #3

Open
Blueglide opened this issue Apr 1, 2017 · 1 comment
Open

Bug in example code #3

Blueglide opened this issue Apr 1, 2017 · 1 comment

Comments

@Blueglide
Copy link

Thanks for postig rambo. Just what I need.

There is a small bug in the example that I'll flag here though. You cannot use sFIFO.count() in the for-loop termination clause because its value continually decrements as the for-loop dequeues and prints items. It meets the index i going down as i is counting up with the result that listing items quits when only half of the total entries have been printed. Mine printed three ofthe five. No big deal, but could cause a novice some grief, thus my note here.

Cheers!

@synaption
Copy link

I personally thought this did a good job demonstrating that sFIFO.count() is not constant. though I did solve it be making sFIFO.count()=x before entering my for loop and then incrementing to x instead.

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

No branches or pull requests

2 participants