refactor: don't use subtraction in qsort() comparison functions

This commit is contained in:
zeertzjq
2024-02-10 21:38:48 +08:00
parent f3982ad3f3
commit 00e785b17f
6 changed files with 36 additions and 17 deletions

View File

@@ -233,7 +233,9 @@ void win_config_float(win_T *wp, WinConfig fconfig)
static int float_zindex_cmp(const void *a, const void *b)
{
return (*(win_T **)b)->w_float_config.zindex - (*(win_T **)a)->w_float_config.zindex;
int za = (*(win_T **)a)->w_float_config.zindex;
int zb = (*(win_T **)b)->w_float_config.zindex;
return za == zb ? 0 : za < zb ? 1 : -1;
}
void win_float_remove(bool bang, int count)