Re: Remove unneccessary memory initialization in planner.c

2025-12-08 Thread Aleksander Alekseev
Hi Chao, > "gd" is allocated by palloc0, so all members have been zero initialized, thus > explicitly assigning NULL to the 4 members is unnecessary. I don't think that > has much runtime impact, but from a readability perspective, a potential > question is that, "gd" has more fields, why only

Remove unneccessary memory initialization in planner.c

2025-12-08 Thread Chao Li
Hi Hackers, In this code piece: ``` static grouping_sets_data * preprocess_grouping_sets(PlannerInfo *root) { ... grouping_sets_data *gd = palloc0(sizeof(grouping_sets_data)); ... gd->any_hashable = false; gd->unhashable_refs = NULL; gd->unsortable_refs = NULL; gd->unsortable_sets = NIL; ... ```