Redundant SAR check #6

Open
opened 2023-01-03 06:44:22 +00:00 by alexisvl · 0 comments

5a766a53ff/src/timdac_ll.c (L68)

This check is redundant - _sar_search() already ensures they aren't inverted. It used to be _tune_sar_top == 0 || _tune_sar_bot == UINT16_MAX, and changing to what it is now created a surprising inflation in code size. I really don't think either of these is necessary and can't really fathom where the previous one came from either. Consider just removing this branch entirely. If the variables got clobbered with invalid numbers somehow, this would result in _sar_search() flipping them around, maybe settling to an incorrect result once, and then this would get filtered down.

https://gitea.alexisvl.rocks/alexisvl/timdac/src/commit/5a766a53ff193bf404a009c4f47bbb36a655a66f/src/timdac_ll.c#L68 This check is redundant - `_sar_search()` already ensures they aren't inverted. It used to be `_tune_sar_top == 0 || _tune_sar_bot == UINT16_MAX`, and changing to what it is now created a surprising inflation in code size. I really don't think _either_ of these is necessary and can't really fathom where the previous one came from either. Consider just removing this branch entirely. If the variables got clobbered with invalid numbers somehow, this would result in `_sar_search()` flipping them around, maybe settling to an incorrect result once, and then this would get filtered down.
alexisvl added this to the 1.0.1 milestone 2023-01-04 03:32:17 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fip/timdac#6
There is no content yet.