Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbf184c4 authored by Andres Morales's avatar Andres Morales Committed by Android (Google) Code Review
Browse files

Merge "make RingBuffer const viable"

parents e5d5773f a21c1da1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ public:
    ~RingBuffer() {}

    constexpr size_t capacity() const { return SIZE; }
    size_t size() { return mCount; }
    size_t size() const { return mCount; }

    T& next() {
        mHead = (mHead + 1) % SIZE;
@@ -54,6 +54,10 @@ public:
        return mBuffer[(mHead + index + 1) % mCount];
    }

    const T& operator[](size_t index) const {
        return mBuffer[(mHead + index + 1) % mCount];
    }

    void clear() {
        mCount = 0;
        mHead = -1;