mirror of
https://github.com/git/git.git
synced 2024-12-02 22:43:44 +08:00
76dd98c139
Add a semantic patch for removing checks similar to the one that QSORT already does internally and apply it to the code base. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
38 lines
610 B
Plaintext
38 lines
610 B
Plaintext
@@
|
|
expression base, nmemb, compar;
|
|
@@
|
|
- qsort(base, nmemb, sizeof(*base), compar);
|
|
+ QSORT(base, nmemb, compar);
|
|
|
|
@@
|
|
expression base, nmemb, compar;
|
|
@@
|
|
- qsort(base, nmemb, sizeof(base[0]), compar);
|
|
+ QSORT(base, nmemb, compar);
|
|
|
|
@@
|
|
type T;
|
|
T *base;
|
|
expression nmemb, compar;
|
|
@@
|
|
- qsort(base, nmemb, sizeof(T), compar);
|
|
+ QSORT(base, nmemb, compar);
|
|
|
|
@@
|
|
expression base, nmemb, compar;
|
|
@@
|
|
- if (nmemb)
|
|
QSORT(base, nmemb, compar);
|
|
|
|
@@
|
|
expression base, nmemb, compar;
|
|
@@
|
|
- if (nmemb > 0)
|
|
QSORT(base, nmemb, compar);
|
|
|
|
@@
|
|
expression base, nmemb, compar;
|
|
@@
|
|
- if (nmemb > 1)
|
|
QSORT(base, nmemb, compar);
|