diff options
| author | Thomas Schmucker <ts@its1.de> | 2021-12-30 11:01:32 +0100 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2021-12-30 11:01:32 +0100 |
| commit | 214f0923ba2981649f14ec3761662332df446d9d (patch) | |
| tree | a400269f616ed53cf378b7ac77bf1f486113c796 /stack.c | |
| parent | 5e696c74c9649b0e54133d46a3ae92e5ce0632fb (diff) | |
| download | data-structures-214f0923ba2981649f14ec3761662332df446d9d.tar.gz data-structures-214f0923ba2981649f14ec3761662332df446d9d.tar.bz2 data-structures-214f0923ba2981649f14ec3761662332df446d9d.zip | |
code cleanup
Diffstat (limited to 'stack.c')
| -rw-r--r-- | stack.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -47,10 +47,10 @@ stack_push(struct stack *stack, T data) | |||
| 47 | bool | 47 | bool |
| 48 | stack_pop(struct stack *stack, T *data) | 48 | stack_pop(struct stack *stack, T *data) |
| 49 | { | 49 | { |
| 50 | if ( stack->head != NULL ) { | 50 | if ( stack->head ) { |
| 51 | struct stack_item *next = stack->head->next; | 51 | struct stack_item *next = stack->head->next; |
| 52 | 52 | ||
| 53 | if ( data != NULL ) { | 53 | if ( data ) { |
| 54 | *data = stack->head->data; | 54 | *data = stack->head->data; |
| 55 | } | 55 | } |
| 56 | free(stack->head); | 56 | free(stack->head); |
