FixedQueue, part 3

This commit is contained in:
tildearrow 2023-07-13 04:23:01 -05:00
parent 708c363635
commit e93f649bfb

View file

@ -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;
} }