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:ForEach Controller Start index for loop not using variable #6370

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

Conversation

n3A87
Copy link

@n3A87 n3A87 commented Oct 26, 2024

Fixes #6108

Comment on lines 201 to 203
if (loopCount < getStartIndex()) {
loopCount = getStartIndex();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a test case to cover the change?
It looks suspicious to call getStartIndex() twice as it might produce different results on every call.

Copy link
Author

Choose a reason for hiding this comment

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

Do you mean you want me to add a unit test about the change? I have only verified that this change can solve the problem. #6180
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean you want me to add a unit test about the change?

Yeah. We need to add tests to prevent accidental regressions.
Here's a sample:

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.

ForEach Controller Start index for loop not using variable
2 participants