From bae3761924e8f98650a096338f6bd4d5179e4bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 17 Jun 2016 16:55:59 +0200 Subject: [PATCH] Fix consumed range constructor. --- source/eventcore/internal/consumablequeue.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/eventcore/internal/consumablequeue.d b/source/eventcore/internal/consumablequeue.d index df3caea..808d5c3 100644 --- a/source/eventcore/internal/consumablequeue.d +++ b/source/eventcore/internal/consumablequeue.d @@ -99,7 +99,7 @@ class ConsumableQueue(T) this(ConsumableQueue queue, size_t first, size_t count) { - if (m_count) { + if (count) { m_queue = queue; m_first = first; m_count = count; @@ -148,11 +148,11 @@ class ConsumableQueue(T) private void consumed(size_t first, bool shift_up) { if (shift_up) { + m_storage[(first+1) & m_capacityMask].rc++; if (!--m_storage[first].rc && first == m_first) { m_first++; m_consumedCount--; } - m_storage[(first+1) & m_capacityMask].rc++; } else { m_storage[first].rc--; if (first == m_first)