summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2019-01-02 00:21:42 +0100
committerUwe Klotz <uklotz@mixxx.org>2019-01-02 00:21:58 +0100
commit7d5400a548bab84d07245b70b9cb7d64b9f3af9d (patch)
tree7168f7a5106f486f93571243730d334e4bcf467c
parent528d609186ecf5e0c933865f323d638db3509b83 (diff)
Fix naming of function
-rw-r--r--src/util/mpscfifo.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/mpscfifo.h b/src/util/mpscfifo.h
index 2531c4e069..cc94f80df0 100644
--- a/src/util/mpscfifo.h
+++ b/src/util/mpscfifo.h
@@ -40,7 +40,7 @@ class MpscFifo {
DEBUG_ASSERT(m_writeIndex >= 0);
DEBUG_ASSERT(m_writeIndex <= capacity);
m_buffer[m_writeIndex] = std::move(value);
- m_writeIndex = nextIndex(m_writeIndex + 1);
+ m_writeIndex = nextIndex(m_writeIndex);
}
// Finally allow the reader to access the enqueued buffer slot
m_readTokens.fetchAndAddRelease(-1);
@@ -58,7 +58,7 @@ class MpscFifo {
DEBUG_ASSERT(m_readIndex >= 0);
DEBUG_ASSERT(m_readIndex <= capacity);
*value = std::move(m_buffer[m_readIndex]);
- m_readIndex = nextIndex(m_readIndex + 1);
+ m_readIndex = nextIndex(m_readIndex);
// Finally allow writers to overwrite the dequeued buffer slot
m_writeTokens.fetchAndAddRelease(-1);
return true;
@@ -66,7 +66,7 @@ class MpscFifo {
private:
static int nextIndex(int index) {
- return index % (capacity + 1);
+ return (index + 1) % (capacity + 1);
}
// One additional slot is needed to decouple writers from the single reader