diff --git a/src/hal/circular_buffer.h b/src/hal/circular_buffer.h index 55d9bf0..1620584 100644 --- a/src/hal/circular_buffer.h +++ b/src/hal/circular_buffer.h @@ -61,15 +61,8 @@ public: } /// @returns number of elements in the buffer - /// @@TODO better solution if it exists inline index_t count() const { - index_t i = tail; - index_t c = 0; - while (i != head) { - i = next(i); - ++c; - } - return c; + return head - tail; } protected: