summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecQue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/vec/vecQue.h')
-rw-r--r--src/misc/vec/vecQue.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/misc/vec/vecQue.h b/src/misc/vec/vecQue.h
index d31abb27..aaa1c01d 100644
--- a/src/misc/vec/vecQue.h
+++ b/src/misc/vec/vecQue.h
@@ -226,7 +226,10 @@ static inline int Vec_QuePop( Vec_Que_t * p )
assert( p->nSize > 1 );
Res = p->pHeap[1]; p->pOrder[Res] = -1;
if ( --p->nSize == 1 )
+ {
+ p->pHeap[1] = -1;
return Res;
+ }
v = p->pHeap[p->nSize]; p->pHeap[p->nSize] = -1;
p->pHeap[1] = v; p->pOrder[v] = 1;
Vec_QueMoveDown( p, v );