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 /src/backend/utils/adt/timestamp.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 'src/backend/utils/adt/timestamp.c')
-rw-r--r-- | src/backend/utils/adt/timestamp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 9799647e1a5..d8552a1f186 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -3290,7 +3290,7 @@ interval_mul(PG_FUNCTION_ARGS) * cascade from months and days. It might still be >24 if the combination * of cascade and the seconds factor operation itself. */ - if (Abs(sec_remainder) >= SECS_PER_DAY) + if (fabs(sec_remainder) >= SECS_PER_DAY) { result->day += (int) (sec_remainder / SECS_PER_DAY); sec_remainder -= (int) (sec_remainder / SECS_PER_DAY) * SECS_PER_DAY; @@ -3347,7 +3347,7 @@ interval_div(PG_FUNCTION_ARGS) sec_remainder = (orig_day / factor - result->day + month_remainder_days - (int) month_remainder_days) * SECS_PER_DAY; sec_remainder = TSROUND(sec_remainder); - if (Abs(sec_remainder) >= SECS_PER_DAY) + if (fabs(sec_remainder) >= SECS_PER_DAY) { result->day += (int) (sec_remainder / SECS_PER_DAY); sec_remainder -= (int) (sec_remainder / SECS_PER_DAY) * SECS_PER_DAY; |