diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-10-07 13:28:38 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-10-07 13:29:33 +0200 |
commit | f14aad5169baa5e2ac25d49f1d18f9d5cb3bc7f2 (patch) | |
tree | e26a18d755d474d8695e763ee118f48146d1bea6 /contrib/intarray/_int_gist.c | |
parent | 0fe954c28584169938e5c0738cfaa9930ce77577 (diff) | |
download | postgresql-f14aad5169baa5e2ac25d49f1d18f9d5cb3bc7f2.tar.gz postgresql-f14aad5169baa5e2ac25d49f1d18f9d5cb3bc7f2.zip |
Remove unnecessary uses of Abs()
Use C standard abs() or fabs() instead.
Reviewed-by: Zhang Mingli <zmlpostgres@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/4beb42b5-216b-bce8-d452-d924d5794c63%40enterprisedb.com
Diffstat (limited to 'contrib/intarray/_int_gist.c')
-rw-r--r-- | contrib/intarray/_int_gist.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/intarray/_int_gist.c b/contrib/intarray/_int_gist.c index 6378aa74b07..f67699bfccc 100644 --- a/contrib/intarray/_int_gist.c +++ b/contrib/intarray/_int_gist.c @@ -4,6 +4,7 @@ #include "postgres.h" #include <limits.h> +#include <math.h> #include "_int.h" #include "access/gist.h" @@ -539,7 +540,7 @@ g_int_picksplit(PG_FUNCTION_ARGS) union_d = inner_int_union(datum_r, datum_alpha); rt__int_size(union_d, &size_beta); pfree(union_d); - costvector[i - 1].cost = Abs((size_alpha - size_l) - (size_beta - size_r)); + costvector[i - 1].cost = fabs((size_alpha - size_l) - (size_beta - size_r)); } qsort((void *) costvector, maxoff, sizeof(SPLITCOST), comparecost); |