Fix out-of-bounds error in ConsumableQueue.
This commit is contained in:
parent
f808f89e7c
commit
80df8e1ce8
|
@ -56,8 +56,10 @@ class ConsumableQueue(T)
|
||||||
{
|
{
|
||||||
foreach (i; 0 .. m_pendingCount)
|
foreach (i; 0 .. m_pendingCount)
|
||||||
if (getPendingAt(i) == item) {
|
if (getPendingAt(i) == item) {
|
||||||
getPendingAt(i) = getPendingAt(m_pendingCount-1);
|
if (m_pendingCount > 1)
|
||||||
|
getPendingAt(i) = getPendingAt(m_pendingCount-1);
|
||||||
m_pendingCount--;
|
m_pendingCount--;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue