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 69e6f11 commit c1ab43cCopy full SHA for c1ab43c
platform/CircularBuffer.h
@@ -106,19 +106,20 @@ class CircularBuffer {
106
}
107
108
/** Get the number of elements currently stored in the circular_buffer */
109
- CounterType size() const
110
- {
+ CounterType size() const {
111
core_util_critical_section_enter();
112
CounterType elements;
113
- if (!_full)
114
115
- if (_head < _tail)
+ if (!_full) {
+ if (_head < _tail) {
116
elements = BufferSize + _head - _tail;
117
- else
+ }
+ else {
118
elements = _head - _tail;
119
120
121
elements = BufferSize;
122
123
core_util_critical_section_exit();
124
return elements;
125
0 commit comments