FixedQueue, part 3
This commit is contained in:
parent
708c363635
commit
e93f649bfb
|
|
@ -112,12 +112,12 @@ template <typename T, size_t items> bool FixedQueue<T,items>::push_front(const T
|
||||||
logW("stack overflow!");
|
logW("stack overflow!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
data[readPos]=item;
|
|
||||||
if (readPos>0) {
|
if (readPos>0) {
|
||||||
readPos--;
|
readPos--;
|
||||||
} else {
|
} else {
|
||||||
readPos=items-1;
|
readPos=items-1;
|
||||||
}
|
}
|
||||||
|
data[readPos]=item;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue