diff options
author | Kirill A. Shutemov <kirill@shutemov.name> | 2011-07-01 00:48:37 +0300 |
---|---|---|
committer | Kirill A. Shutemov <kirill@shutemov.name> | 2011-07-05 17:52:39 +0300 |
commit | 0b0a6b115d617fe79a0be0ddecd89738aefa574c (patch) | |
tree | 13cc8fcf47fa568d51e1a275f1ef99bf7651eaa5 /src/vector.c | |
parent | c20ffa6104cf9797a14cc40dcc963102ef9a98a2 (diff) | |
download | libgit2-0b0a6b115d617fe79a0be0ddecd89738aefa574c.tar.gz |
vector, index: use git__msort() for vector sorting
Index operation use git_vector_sort() to sort index entries. Since index
support adding duplicates (two or more entries with the same path), it's
important to preserve order of elements. Preserving order of elements
allows to make decisions based on order. For example it's possible to
implement function witch removes all duplicates except last added.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Diffstat (limited to 'src/vector.c')
-rw-r--r-- | src/vector.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vector.c b/src/vector.c index 0451eb082..8d09350fc 100644 --- a/src/vector.c +++ b/src/vector.c @@ -94,7 +94,7 @@ void git_vector_sort(git_vector *v) if (v->sorted || v->_cmp == NULL) return; - qsort(v->contents, v->length, sizeof(void *), v->_cmp); + git__msort(v->contents, v->length, sizeof(void *), v->_cmp); v->sorted = 1; } |