Code style updated

pull/5058/head
0x6d61726b 2017-10-20 22:06:01 +02:00 committed by GitHub
parent 69e6f11c2d
commit c1ab43ce76
1 changed files with 8 additions and 7 deletions

View File

@ -106,19 +106,20 @@ public:
} }
/** Get the number of elements currently stored in the circular_buffer */ /** Get the number of elements currently stored in the circular_buffer */
CounterType size() const CounterType size() const {
{
core_util_critical_section_enter(); core_util_critical_section_enter();
CounterType elements; CounterType elements;
if (!_full) if (!_full) {
{ if (_head < _tail) {
if (_head < _tail)
elements = BufferSize + _head - _tail; elements = BufferSize + _head - _tail;
else }
else {
elements = _head - _tail; elements = _head - _tail;
} }
else }
else {
elements = BufferSize; elements = BufferSize;
}
core_util_critical_section_exit(); core_util_critical_section_exit();
return elements; return elements;
} }