Optimise CircularIndex count

No change in memory
pull/282/head
Guðni Már Gilbert 2023-06-02 19:31:11 +00:00 committed by DRracer
parent edec4708b5
commit 1633d9af9b
1 changed files with 1 additions and 8 deletions

View File

@ -61,15 +61,8 @@ public:
} }
/// @returns number of elements in the buffer /// @returns number of elements in the buffer
/// @@TODO better solution if it exists
inline index_t count() const { inline index_t count() const {
index_t i = tail; return head - tail;
index_t c = 0;
while (i != head) {
i = next(i);
++c;
}
return c;
} }
protected: protected: