diff --git a/source/vibe/container/ringbuffer.d b/source/vibe/container/ringbuffer.d index a9f575e..b7e35f3 100644 --- a/source/vibe/container/ringbuffer.d +++ b/source/vibe/container/ringbuffer.d @@ -178,6 +178,8 @@ struct RingBuffer(T, size_t N = 0, bool INITIALIZE = true) { void removeFrontN(size_t n) { assert(length >= n); + if (!length) return; + static if (hasElaborateDestructor!T) { foreach (i; 0 .. n) destroy(m_buffer[mod(m_start + i)]);