summaryrefslogtreecommitdiffstats
path: root/src/Queue.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Queue.hpp')
-rw-r--r--src/Queue.hpp10
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.