mackron / dr_libs

Audio decoding libraries for C/C++, each in a single source file.
Other
1.24k stars 205 forks source link

dr_flac: Remove comparison that is always true #178

Closed dreamer closed 3 years ago

dreamer commented 3 years ago

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.

mackron commented 3 years ago

Thanks. Merged to the dev branch.

kcgen commented 3 years ago

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

Screenshot_20210125-052411_Brave