Fix ConsumableQueue.consume with no entries present.

This commit is contained in:
Sönke Ludwig 2017-01-23 11:33:45 +01:00
parent 0422ee495c
commit e5078ad399
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C

View file

@ -70,6 +70,7 @@ final class ConsumableQueue(T)
*/
ConsumedRange consume()
@safe {
if (!m_pendingCount) return ConsumedRange(null, 0, 0);
auto first = (m_first + m_consumedCount) % m_storage.length;
auto count = m_pendingCount;
m_consumedCount += count;