diff options
author | David Robillard <d@drobilla.net> | 2020-11-27 17:57:57 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-27 21:42:51 +0100 |
commit | b04fa862a1daeabd0a60a479cb5e3cacac4c94b2 (patch) | |
tree | 39544d105c5a0087aef8984599680be094480d91 /src/Queue.hpp | |
parent | 1be7c1b92c06880cf21f79cfa5419240f14e4fa4 (diff) | |
download | patchage-b04fa862a1daeabd0a60a479cb5e3cacac4c94b2.tar.gz patchage-b04fa862a1daeabd0a60a479cb5e3cacac4c94b2.tar.bz2 patchage-b04fa862a1daeabd0a60a479cb5e3cacac4c94b2.zip |
Don't use else after return
I don't always agree with this one, but in this case it's reasonable enough.
Diffstat (limited to 'src/Queue.hpp')
-rw-r--r-- | src/Queue.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Queue.hpp b/src/Queue.hpp index 41f84bb..b951b56 100644 --- a/src/Queue.hpp +++ b/src/Queue.hpp @@ -112,12 +112,12 @@ Queue<T>::push(const T& elem) { if (full()) { return false; - } else { - unsigned back = _back.load(); - _objects[back] = elem; - _back = (back + 1) % _size; - return true; } + + const unsigned back = _back.load(); + _objects[back] = elem; + _back = (back + 1) % _size; + return true; } /** Pop an item off the front of the queue - realtime-safe, not thread-safe. |