Commit 0b0a6b11 by Kirill A. Shutemov

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>
parent c20ffa61
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment