diff options
Diffstat (limited to 'src/vector.c')
-rw-r--r-- | src/vector.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vector.c b/src/vector.c index db1dcf89a..baec8036f 100644 --- a/src/vector.c +++ b/src/vector.c @@ -401,3 +401,19 @@ int git_vector_verify_sorted(const git_vector *v) return 0; } + +void git_vector_reverse(git_vector *v) +{ + size_t a, b; + + a = 0; + b = v->length - 1; + + while (a < b) { + void *tmp = v->contents[a]; + v->contents[a] = v->contents[b]; + v->contents[b] = tmp; + a++; + b--; + } +} |