Skip to content

fix random range for stock index #161

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

Closed
wants to merge 1 commit into from

Conversation

ItaHeld90
Copy link

@ItaHeld90 ItaHeld90 commented May 4, 2018

In chapter 9 demo project, you use a function randInRange to return a random stock index.
As The upper bound, you send stockIds.length - 1, though the upper bound is exclusive.
I changed it to stockIds.length.

### Note: Currently this small bug presents no symptoms, coincidentally, due to another bug (See #160) that adds a redundant item to the array.
After the fix presented in #160, the last stock never receive any updates.

@getify
Copy link
Owner

getify commented May 4, 2018

'randInRange(..)' is supposed to be inclusive of the upper range.

@ItaHeld90
Copy link
Author

Opened a new PR regarding the randInRange upper bound.

@ItaHeld90 ItaHeld90 closed this May 4, 2018
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