1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-01 01:04:50 +03:00

Replace GUC_UNIT_MEMORY|GUC_UNIT_TIME with GUC_UNIT.

We used (GUC_UNIT_MEMORY | GUC_UNIT_TIME) instead of GUC_UNIT some
places but we already define it in guc.h. This commit replaces them
with GUC_UNIT for better consistency with their surrounding code.

Author: Japin Li
Reviewed-by: Richard Guo, Michael Paquier, Masahiko Sawada
Discussion: https://postgr.es/m/MEYP282MB1669EC0FED922F7A151673ACB65AA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
This commit is contained in:
Masahiko Sawada 2023-06-15 17:04:19 +09:00
parent c00fbe89dc
commit a54fc892ad

View File

@ -2766,7 +2766,7 @@ convert_real_from_base_unit(double base_value, int base_unit,
const char * const char *
get_config_unit_name(int flags) get_config_unit_name(int flags)
{ {
switch (flags & (GUC_UNIT_MEMORY | GUC_UNIT_TIME)) switch (flags & GUC_UNIT)
{ {
case 0: case 0:
return NULL; /* GUC has no units */ return NULL; /* GUC has no units */
@ -2802,7 +2802,7 @@ get_config_unit_name(int flags)
return "min"; return "min";
default: default:
elog(ERROR, "unrecognized GUC units value: %d", elog(ERROR, "unrecognized GUC units value: %d",
flags & (GUC_UNIT_MEMORY | GUC_UNIT_TIME)); flags & GUC_UNIT);
return NULL; return NULL;
} }
} }