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

Small bug in algos/base.py #11

Open
anniezhi opened this issue Nov 21, 2022 · 3 comments
Open

Small bug in algos/base.py #11

anniezhi opened this issue Nov 21, 2022 · 3 comments

Comments

@anniezhi
Copy link

Hi, I think line 127 and line 167 both use 'i' as the enumerating index, but they form a nested loop. This can cause incorrect index referencing once 'done' is not full of 'False'.

@lcswillems
Copy link
Owner

lcswillems commented Dec 29, 2022

Hi Xiaoying, I don't see the bug you are referring too. The variable i is not used after the for loop line 167, so how could it cause a bug?

@anniezhi
Copy link
Author

anniezhi commented Jan 9, 2023

Hi Lucas, Thanks for getting back. Variable 'i' is still used in the for loop started at line 127, after exiting the for loop in line 167. The for loop at line 167 is nested within the for loop at line 127.

@anniezhi
Copy link
Author

anniezhi commented Jan 9, 2023

I see. Index variables with the same name in nested loops do not cause problems anymore :) In that case the current code works perfectly.

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