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

dr_flac: Remove comparison that is always true #178

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

dreamer
Copy link
Contributor

@dreamer dreamer commented Jan 23, 2021

Comparison is always true, because code above returns early when
unsigned blockSize is 0. This invariant is asserted just before
if-else chain.


This is a follow up to #176 - to present an alternative fix. I also experimented with replacing these if-else's with a switch statement, but replacing this single comparison with an assert is less invasive change, and more readable.

Comparison is always true, because code above returns early when
unsigned blockSize is 0. This invariant is asserted just before
if-else chain.
@mackron mackron changed the base branch from master to dev January 25, 2021 08:40
@mackron mackron merged commit 2148269 into mackron:dev Jan 25, 2021
@mackron
Copy link
Owner

mackron commented Jan 25, 2021

Thanks. Merged to the dev branch.

@kcgen
Copy link

kcgen commented Jan 25, 2021

All three dev warning updates are passing, thank you @mackron!

Screenshot_20210125-052411_Brave

@dreamer dreamer deleted the po/lgtm-fix-1 branch January 25, 2021 14:43
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.

3 participants