summaryrefslogtreecommitdiff
path: root/src/01/01a/priority_queue.c
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-07-05 14:01:59 -0600
committermo khan <mo.khan@gmail.com>2020-07-05 14:01:59 -0600
commit8bf32957fef23b85b1421c38b6416047bcba476e (patch)
tree3eece4d270f52c91a6c22e84b6eb636fd57326c1 /src/01/01a/priority_queue.c
parente27441426cd127c1f9969da1fcd2fde0ab415586 (diff)
run make fmt
Diffstat (limited to 'src/01/01a/priority_queue.c')
-rw-r--r--src/01/01a/priority_queue.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/01/01a/priority_queue.c b/src/01/01a/priority_queue.c
index d3acbf6..03eb202 100644
--- a/src/01/01a/priority_queue.c
+++ b/src/01/01a/priority_queue.c
@@ -33,9 +33,7 @@ static Node *create_node(int priority, int data) {
* @param self The queue to investigate
* @return The total number of items stored in the queue.
*/
-int size(PriorityQueue *self) {
- return self->size;
-}
+int size(PriorityQueue *self) { return self->size; }
/**
* Compares two integers and returns:
@@ -129,7 +127,7 @@ void inspect(PriorityQueue *self) {
Node *tmp = self->head;
printf("Items (%d): [ ", size(self));
- while(tmp) {
+ while (tmp) {
printf("(%d,%d) ", tmp->priority, tmp->data);
tmp = tmp->next;
}
@@ -146,10 +144,11 @@ void destroy(PriorityQueue *self) {
Node *current = self->head;
Node *tmp;
- while(current) {
+ while (current) {
tmp = current, current = current->next;
- if (tmp) free(tmp);
+ if (tmp)
+ free(tmp);
}
free(self);
}