Skip to content

Commit

Permalink
array: Wrap array_alloc as a single statement
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed Nov 1, 2013
1 parent 51a3dfb commit 7334238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ GIT_INLINE(void *) git_array_grow(void *_a, size_t item_size)
}

#define git_array_alloc(a) \
((a).size >= (a).asize) ? \
(((a).size >= (a).asize) ? \
git_array_grow(&(a), sizeof(*(a).ptr)) : \
((a).ptr ? &(a).ptr[(a).size++] : NULL)
((a).ptr ? &(a).ptr[(a).size++] : NULL))

#define git_array_last(a) ((a).size ? &(a).ptr[(a).size - 1] : NULL)

Expand Down

0 comments on commit 7334238

Please sign in to comment.