pop() better

This commit is contained in:
Robin Müller 2020-05-05 19:07:11 +02:00
parent 88f229cef9
commit df9e66834e

View File

@ -70,13 +70,8 @@ public:
} }
ReturnValue_t pop() { ReturnValue_t pop() {
if(empty()) { T value;
return EMPTY; return this->retrieve(&value);
} else {
readIndex = next(readIndex);
--currentSize;
return HasReturnvaluesIF::RETURN_OK;
}
} }
static const uint8_t INTERFACE_ID = CLASS_ID::FIFO_CLASS; static const uint8_t INTERFACE_ID = CLASS_ID::FIFO_CLASS;