Skip to content

Fix #114: remove redundant initial state check in LC_SampleAPs - #140

Open
philphauler wants to merge 1 commit into
nasa:devfrom
philphauler:fix-114-v2
Open

Fix #114: remove redundant initial state check in LC_SampleAPs#140
philphauler wants to merge 1 commit into
nasa:devfrom
philphauler:fix-114-v2

Conversation

@philphauler

Copy link
Copy Markdown

Summary

Remove the redundant guard on the starting AP state in LC_SampleAPs.

Problem

LC_SampleAPs(StartIndex, EndIndex) checks ARTPtr[StartIndex].CurrentState
before entering the sampling loop. If the first AP is PERMOFF or NOT_USED,
the entire range is skipped and an error event is emitted -- even though
subsequent APs in the range may be operational.

LC_SampleSingleAP already checks each AP state individually, making this
pre-check redundant and harmful when a range begins with a disabled AP.

Fix

Remove the pre-check. Let LC_SampleSingleAP handle per-AP state filtering
for each action point in the range. Net deletion of 21 lines.

The guard on the starting AP's state prevented sampling the entire
range when the first AP happened to be PERMOFF or NOT_USED.
LC_SampleSingleAP already checks each AP's state individually,
making this pre-check redundant and harmful.
@philphauler

Copy link
Copy Markdown
Author

Removes a redundant initial-state check that LC_SampleSingleAP already handles per-AP. 6 lines added, 27 removed. No behavioral change — the per-AP handler covers all cases.

@dzbaker

dzbaker commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@philphauler Thank you for your contribution. Please resolve the workflow failures.

@philphauler

Copy link
Copy Markdown
Author

Already onnit 🫡🙏

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.

2 participants