We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c22dca commit 546743aCopy full SHA for 546743a
platform/CircularBuffer.h
@@ -92,10 +92,14 @@ class CircularBuffer {
92
core_util_critical_section_enter();
93
if (full()) {
94
_tail++;
95
- _tail %= BufferSize;
+ if(_tail == BufferSize) {
96
+ _tail = 0;
97
+ }
98
}
99
_pool[_head++] = data;
- _head %= BufferSize;
100
+ if(_head == BufferSize) {
101
+ _head = 0;
102
103
if (_head == _tail) {
104
_full = true;
105
@@ -113,7 +117,9 @@ class CircularBuffer {
113
117
114
118
if (!empty()) {
115
119
data = _pool[_tail++];
116
120
121
122
123
_full = false;
124
data_popped = true;
125
0 commit comments