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: Simplify loop stopping condition to prevent off-by-one errors #6696

Merged
merged 9 commits into from
Feb 20, 2025

Conversation

Cristhianzl
Copy link
Member

This pull request includes changes to the LoopTemplate.json file and a minor update to the evaluate_stop_loop method in the loop.py file. The changes primarily focus on formatting and improving the logic for evaluating when to stop the loop.

Logic Improvement:

  • Modified the evaluate_stop_loop method in loop.py to ensure the loop correctly evaluates when to stop by using max(data_length - 1, 0) instead of just data_length. This prevents potential off-by-one errors.

… should stop based on current index and data length

📝 (LoopTemplate.json): Update output_types to be arrays for consistency and readability in LoopTemplate JSON file
…p should stop or continue based on current index and data length
@Cristhianzl Cristhianzl self-assigned this Feb 18, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Feb 18, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 18, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 18, 2025
Copy link

codspeed-hq bot commented Feb 18, 2025

CodSpeed Performance Report

Merging #6696 will not alter performance

Comparing cz/loop-interation (a9bbc28) with main (02617ff)

Summary

✅ 14 untouched benchmarks

@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 18, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 19, 2025
@Cristhianzl Cristhianzl added lgtm This PR has been approved by a maintainer and removed lgtm This PR has been approved by a maintainer labels Feb 19, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 19, 2025
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 19, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 19, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 19, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 20, 2025
@Cristhianzl Cristhianzl added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit af2d77d Feb 20, 2025
36 checks passed
@Cristhianzl Cristhianzl deleted the cz/loop-interation branch February 20, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants