Fix #822, Remove iterator modification in loop#826
Fix #822, Remove iterator modification in loop#826yammajamma merged 1 commit intonasa:integration-candidatefrom
Conversation
CDKnightNASA
left a comment
There was a problem hiding this comment.
I thought there was some discouragement from using breaks/continues in loops (akin to using returns in the middle of code.) I think breaks/continues/returns are fine and here's a good example of the contrary problem when they're avoided.
|
I see no mention of avoiding break/continue in Goddard's c coding standard. Alternatively could implement multiple conditions to end the for loop, but I've heard reviewers not like that approach either. |
|
Would it make sense to use a while loop? |
|
I'm not aware of a coding standard that prefers one way over the other. Without a preference/standard stated, I don't think it's worth changing code. Either way there's an iterator and two exit conditions, for loop with a break seems fine to me. |
|
CCB 2020-08-26 - APPROVED |
Describe the contribution
Fix #822 - removed iterator modification from within the loop... replaced with break.
Testing performed
Built and ran unit tests.
Expected behavior changes
None
System(s) tested on
Additional context
None
Third party code
None
Contributor Info - All information REQUIRED for consideration of pull request
Jacob Hageman - NASA/GSFC