mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
use QSORT
Apply the semantic patch contrib/coccinelle/qsort.cocci to the code base, replacing calls of qsort(3) with QSORT. The resulting code is shorter and supports empty arrays with NULL pointers. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
dbc540c7a5
commit
9ed0d8d6e6
3
tree.c
3
tree.c
@@ -180,8 +180,7 @@ int read_tree(struct tree *tree, int stage, struct pathspec *match)
|
||||
* Sort the cache entry -- we need to nuke the cache tree, though.
|
||||
*/
|
||||
cache_tree_free(&active_cache_tree);
|
||||
qsort(active_cache, active_nr, sizeof(active_cache[0]),
|
||||
cmp_cache_name_compare);
|
||||
QSORT(active_cache, active_nr, cmp_cache_name_compare);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user