1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

AK: Calculate CircularQueue::end() correctly

Previously end() was only correct when m_head == 0.
This commit is contained in:
Peter Elliott 2021-10-06 00:55:28 -06:00 committed by Andreas Kling
parent 3b7d8ed6a5
commit c515121844

View file

@ -93,7 +93,7 @@ public:
}; };
ConstIterator begin() const { return ConstIterator(*this, m_head); } ConstIterator begin() const { return ConstIterator(*this, m_head); }
ConstIterator end() const { return ConstIterator(*this, size()); } ConstIterator end() const { return ConstIterator(*this, (m_head + size()) % Capacity); }
size_t head_index() const { return m_head; } size_t head_index() const { return m_head; }