pgsql: Clean up qsort comparison function for GUC entries
| От | Peter Eisentraut |
|---|---|
| Тема | pgsql: Clean up qsort comparison function for GUC entries |
| Дата | |
| Msg-id | E1vIiPp-0061uc-0u@gemulon.postgresql.org обсуждение исходный текст |
| Список | pgsql-committers |
Clean up qsort comparison function for GUC entries guc_var_compare() is invoked from qsort() on an array of struct config_generic, but the function accesses these directly as strings (char *). This relies on the name being the first field, so this works. But we can write this more clearly by using the struct and then accessing the field through the struct. Before the reorganization of the GUC structs (commit a13833c35f9), the old code was probably more convenient, but now we can write this more clearly and correctly. After this change, it is no longer required that the name is the first field in struct config_generic, so remove that comment. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/2c961fa1-14f6-44a2-985c-e30b95654e8d%40eisentraut.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d2f24df19b7a42a0944a6926a0ca54168dcefe3a Modified Files -------------- src/backend/utils/misc/guc.c | 6 +++--- src/include/utils/guc_tables.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
В списке pgsql-committers по дате отправления: