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

Slight loop simplification possible in LC_SampleAPReq #106

Closed
2 tasks done
thnkslprpt opened this issue Jan 30, 2024 · 0 comments · Fixed by #107
Closed
2 tasks done

Slight loop simplification possible in LC_SampleAPReq #106

thnkslprpt opened this issue Jan 30, 2024 · 0 comments · Fixed by #107

Comments

@thnkslprpt
Copy link
Contributor

Checklist

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
The continue is unnessesary if the prior if condition just checks for > 0 instead of == 0.

Code snips

LC/fsw/src/lc_cmds.c

Lines 90 to 106 in 752a024

if ((LC_SampleAP->UpdateAge != 0) && (ValidSampleCmd))
{
for (WatchIndex = 0; WatchIndex < LC_MAX_WATCHPOINTS; WatchIndex++)
{
if (LC_OperData.WRTPtr[WatchIndex].CountdownToStale == 0)
{
continue;
}
LC_OperData.WRTPtr[WatchIndex].CountdownToStale--;
if (LC_OperData.WRTPtr[WatchIndex].CountdownToStale == 0)
{
LC_OperData.WRTPtr[WatchIndex].WatchResult = LC_WATCH_STALE;
}
}
}

Reporter Info
Avi Weiss   @thnkslprpt

thnkslprpt added a commit to thnkslprpt/LC that referenced this issue Jan 30, 2024
thnkslprpt added a commit to thnkslprpt/LC that referenced this issue Jan 30, 2024
thnkslprpt added a commit to thnkslprpt/LC that referenced this issue Jul 9, 2024
@dzbaker dzbaker closed this as completed in 5f911a6 Dec 5, 2024
dzbaker added a commit that referenced this issue Dec 5, 2024
…ntinue-from-LC_SampleAPReq

Fix #106, Simplify loop in `LC_SampleAPReq` by removing `continue`
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 a pull request may close this issue.

1 participant