audio_wavefiles icon indicating copy to clipboard operation
audio_wavefiles copied to clipboard

Improve readability of code by using if expression

Open pjljvandelaar opened this issue 3 years ago • 2 comments

The code is simplified by using if expressions (and simplifying that when possible).

This pull requests solves https://github.com/Ada-Audio/audio_wavefiles/issues/5

Problem detected and solved by Rejuvenation-Ada crate vote for Rejuvenation-Ada as The 2022 Ada Crate Of The Year

pjljvandelaar avatar Nov 30 '22 08:11 pjljvandelaar

If this merge is accepted, I could also check for the usage of short circuit versions of Boolean operators:

See e.g. https://github.com/TNO/Rewriters-Ada/blob/47ca5f092d736ce7ab86a0214008023dd59b2f4f/src/predefined_rewriters_prefer_short_circuit.ads#L26-L31

pjljvandelaar avatar Dec 06 '22 11:12 pjljvandelaar

Sorry for the delay: I'll take a look into your changes as soon as I have some spare time.

Feel free to perform others checks. The only thing I'd like to ask you, though, is to avoid creating an issue and a pull request at the same time: creating a pull request alone is more than sufficient.

gusthoff avatar Dec 09 '22 11:12 gusthoff