Skip to content

Commit

Permalink
chore: readable vec_pop
Browse files Browse the repository at this point in the history
  • Loading branch information
javalsai committed Nov 1, 2024
1 parent 06fa419 commit b8caf5b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ void* vec_pop(struct Vector* vec) {
if (vec->length == 0)
return NULL;

vec->length--;
return vec->pages[vec->length];
return vec->pages[--vec->length];
}

void* vec_get(struct Vector* vec, uint32_t index) {
Expand Down

0 comments on commit b8caf5b

Please sign in to comment.