diff options
| author | Thomas Schmucker <ts@its1.de> | 2021-12-29 10:48:03 +0100 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2021-12-29 10:48:03 +0100 |
| commit | 6ced2a50056acbf7caec404a1edfa3b07fa1ac5d (patch) | |
| tree | ef9d4e6bcf9797b74e13ddbf943f424ac1d49664 /queue.c | |
| parent | 87e013bc707860a6f299a2ee3866965a4fae12be (diff) | |
| download | data-structures-6ced2a50056acbf7caec404a1edfa3b07fa1ac5d.tar.gz data-structures-6ced2a50056acbf7caec404a1edfa3b07fa1ac5d.tar.bz2 data-structures-6ced2a50056acbf7caec404a1edfa3b07fa1ac5d.zip | |
feat: remove NULL-checks
Diffstat (limited to 'queue.c')
| -rw-r--r-- | queue.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -53,10 +53,10 @@ queue_put(struct queue *queue, T data) | |||
| 53 | bool | 53 | bool |
| 54 | queue_get(struct queue *queue, T *data) | 54 | queue_get(struct queue *queue, T *data) |
| 55 | { | 55 | { |
| 56 | if ( queue->head != NULL ) { | 56 | if ( queue->head ) { |
| 57 | struct queue_item *next = queue->head->next; | 57 | struct queue_item *next = queue->head->next; |
| 58 | 58 | ||
| 59 | if ( data != NULL ) { | 59 | if ( data ) { |
| 60 | *data = queue->head->data; | 60 | *data = queue->head->data; |
| 61 | } | 61 | } |
| 62 | free(queue->head); | 62 | free(queue->head); |
