Refactor unit conversions code in guc.c.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 23 Feb 2015 16:06:16 +0000 (18:06 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 23 Feb 2015 16:06:16 +0000 (18:06 +0200)
commit1b6302647302f459fdb63008c3842a1b0d43d1b7
tree8da823a51b8e3dca3a8b441d10a559bfa50a50a7
parentbc208a5a2f9eb34bf795374fa5381e0c82073255
Refactor unit conversions code in guc.c.

Replace the if-switch-case constructs with two conversion tables,
containing all the supported conversions between human-readable unit
strings and the base units used in GUC variables. This makes the code
easier to read, and makes adding new units simpler.
src/backend/utils/misc/guc.c
src/include/utils/guc.h