feat(queue): added is empty function to queue
This commit is contained in:
parent
9893d2f268
commit
c7892da31b
2 changed files with 6 additions and 0 deletions
|
|
@ -42,4 +42,6 @@ FledastyError fledasty_queue_push(FledastyQueue *current_queue, void *value);
|
|||
void *fledasty_queue_peek(FledastyQueue *current_queue);
|
||||
void *fledasty_queue_pop(FledastyQueue *current_queue);
|
||||
|
||||
static inline size_t fledasty_queue_is_empty(FledastyQueue *current_queue) { return current_queue->size == 0; }
|
||||
|
||||
#endif
|
||||
|
|
@ -38,6 +38,10 @@ int main() {
|
|||
printf("Popped: %d\n", *popped_data);
|
||||
}
|
||||
|
||||
if (fledasty_queue_is_empty(&test_queue)) {
|
||||
printf("Queue is empty\n");
|
||||
}
|
||||
|
||||
fledasty_queue_destroy(&test_queue);
|
||||
|
||||
printf("Done\n");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue