Fix crash when reading from RingBuffer if it's full
This commit is contained in:
@@ -69,13 +69,11 @@ public:
|
||||
|
||||
FORCE_INLINE T& PeekFront()
|
||||
{
|
||||
ASSERT(_front != _back);
|
||||
return _allocation.Get()[_front];
|
||||
}
|
||||
|
||||
FORCE_INLINE const T& PeekFront() const
|
||||
{
|
||||
ASSERT(_front != _back);
|
||||
return _allocation.Get()[_front];
|
||||
}
|
||||
|
||||
@@ -93,7 +91,6 @@ public:
|
||||
|
||||
void PopFront()
|
||||
{
|
||||
ASSERT(_front != _back);
|
||||
Memory::DestructItems(_allocation.Get() + _front, 1);
|
||||
_front = (_front + 1) % _capacity;
|
||||
_count--;
|
||||
|
||||
Reference in New Issue
Block a user