diff options
author | David Robillard <d@drobilla.net> | 2022-08-18 01:22:18 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-18 01:22:18 -0400 |
commit | 3af246bb3291d8568f6d110884fa55ee5fd20221 (patch) | |
tree | 434ac316050356e4db379ba8305b75285b17bbba /src/server/Buffer.hpp | |
parent | 44381dbda9dbf8d20894789fe8e3ea941b70a1d0 (diff) | |
download | ingen-3af246bb3291d8568f6d110884fa55ee5fd20221.tar.gz ingen-3af246bb3291d8568f6d110884fa55ee5fd20221.tar.bz2 ingen-3af246bb3291d8568f6d110884fa55ee5fd20221.zip |
Avoid "else" after "return", "break", and "continue"
Diffstat (limited to 'src/server/Buffer.hpp')
-rw-r--r-- | src/server/Buffer.hpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index b1d8fb4d..d10aeb5c 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -95,9 +95,12 @@ public: if (is_control()) { return static_cast<const Sample*>( LV2_ATOM_BODY_CONST(get<LV2_Atom_Float>())); - } else if (is_audio()) { + } + + if (is_audio()) { return static_cast<const Sample*>(_buf); } + return nullptr; } @@ -105,9 +108,12 @@ public: inline Sample* samples() { if (is_control()) { return static_cast<Sample*>(LV2_ATOM_BODY(get<LV2_Atom_Float>())); - } else if (is_audio()) { + } + + if (is_audio()) { return static_cast<Sample*>(_buf); } + return nullptr; } @@ -115,9 +121,12 @@ public: inline Sample value_at(SampleCount offset) const { if (is_audio() || is_control()) { return samples()[offset]; - } else if (_value_buffer) { + } + + if (_value_buffer) { return reinterpret_cast<const LV2_Atom_Float*>(value())->body; } + return 0.0f; } |