summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h
index e2f729b83..1bda9c93d 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -78,4 +78,13 @@ void git_vector_remove_matching(
int git_vector_resize_to(git_vector *v, size_t new_length);
int git_vector_set(void **old, git_vector *v, size_t position, void *value);
+/** Set the comparison function used for sorting the vector */
+GIT_INLINE(void) git_vector_set_cmp(git_vector *v, git_vector_cmp cmp)
+{
+ if (cmp != v->_cmp) {
+ v->_cmp = cmp;
+ v->sorted = 0;
+ }
+}
+
#endif