summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2016-09-23 12:42:33 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2016-10-06 11:04:55 +0200
commit0bd43371c27b5fee23768c1b369bf2c62601578f (patch)
treeb9b04e70097439d19482f236018c35ea4e11dd05 /src/vector.h
parent6708618c10f509ed1d22298628bf578a514d2624 (diff)
downloadlibgit2-0bd43371c27b5fee23768c1b369bf2c62601578f.tar.gz
vector, pqueue: add git_vector_reverse and git_pqueue_reverse
This is a convenience function to reverse the contents of a vector and a pqueue in-place. The pqueue function is useful in the case where we're treating it as a LIFO queue.
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h
index 96d149e16..cc4c314d5 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -118,4 +118,9 @@ GIT_INLINE(void) git_vector_set_cmp(git_vector *v, git_vector_cmp cmp)
/* Just use this in tests, not for realz. returns -1 if not sorted */
int git_vector_verify_sorted(const git_vector *v);
+/**
+ * Reverse the vector in-place.
+ */
+void git_vector_reverse(git_vector *v);
+
#endif