chiapos icon indicating copy to clipboard operation
chiapos copied to clipboard

Removes redundant booleans

Open gilnobrega opened this issue 3 years ago • 3 comments

After the if clause (shift >= 128) fails, it is ensured that shift is less than 128 when it goes through that part of the code, hence (128 > shift) is the same as (shift < 128) which is always true. Therefore it can be removed from both clauses.

gilnobrega avatar Jul 26 '21 04:07 gilnobrega

this change is correct and silences the LGTM issues. I looked at this months ago, and I have some issues with this change:

  1. I don't believe there are any tests covering this change
  2. There may be tests in the original repository that we copy-pasted this code from, but we're not running them
  3. We really should use the version from the original repo and contribute changes like these (and perhaps tests if there aren't any)

arvidn avatar Jul 26 '21 04:07 arvidn

This pull request fixes 2 alerts when merging 4fcd6c645f6bbb4f8c92d93368fd03df04e2318e into 32c7afacd87b5943fce4f558081b2c79be9e30b5 - view on LGTM.com

fixed alerts:

  • 2 for Comparison result is always the same

lgtm-com[bot] avatar Jul 26 '21 04:07 lgtm-com[bot]

'This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed.'

github-actions[bot] avatar Sep 24 '21 11:09 github-actions[bot]