diff options
author | David Rowley <drowley@postgresql.org> | 2022-08-26 02:35:40 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2022-08-26 02:35:40 +1200 |
commit | 3e0fff2e6888e39b0ad5cdfdb78bc1c2bb2b22c9 (patch) | |
tree | 235e23ee1c87eb2f148216535c0d300bcbe0a64e /src/backend/optimizer/plan/planner.c | |
parent | e3ce2de09d814f8770b2e3b3c152b7671bcdb83f (diff) |
More -Wshadow=compatible-local warning fixes
In a similar effort to f01592f91, here we're targetting fixing the
warnings where we've deemed the shadowing variable to serve a close enough
purpose to the shadowed variable just to reuse the shadowed version and
not declare the shadowing variable at all.
By my count, this takes the warning count from 106 down to 71.
Author: Justin Pryzby
Discussion: https://postgr.es/m/20220825020839.GT2342@telsasoft.com
Diffstat (limited to 'src/backend/optimizer/plan/planner.c')
-rw-r--r-- | src/backend/optimizer/plan/planner.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index d929ce34171..079bd0bfdfd 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -3484,8 +3484,6 @@ get_number_of_groups(PlannerInfo *root, if (gd->hash_sets_idx) { - ListCell *lc; - gd->dNumHashGroups = 0; groupExprs = get_sortgrouplist_exprs(parse->groupClause, @@ -4720,8 +4718,6 @@ create_final_distinct_paths(PlannerInfo *root, RelOptInfo *input_rel, Path *cheapest_input_path = input_rel->cheapest_total_path; double numDistinctRows; bool allow_hash; - Path *path; - ListCell *lc; /* Estimate number of distinct rows there will be */ if (parse->groupClause || parse->groupingSets || parse->hasAggs || @@ -4766,6 +4762,8 @@ create_final_distinct_paths(PlannerInfo *root, RelOptInfo *input_rel, * the other.) */ List *needed_pathkeys; + Path *path; + ListCell *lc; if (parse->hasDistinctOn && list_length(root->distinct_pathkeys) < @@ -4776,7 +4774,7 @@ create_final_distinct_paths(PlannerInfo *root, RelOptInfo *input_rel, foreach(lc, input_rel->pathlist) { - Path *path = (Path *) lfirst(lc); + path = (Path *) lfirst(lc); if (pathkeys_contained_in(needed_pathkeys, path->pathkeys)) { @@ -5034,8 +5032,6 @@ create_ordered_paths(PlannerInfo *root, */ if (enable_incremental_sort && list_length(root->sort_pathkeys) > 1) { - ListCell *lc; - foreach(lc, input_rel->partial_pathlist) { Path *input_path = (Path *) lfirst(lc); @@ -7607,7 +7603,6 @@ apply_scanjoin_target_to_paths(PlannerInfo *root, AppendRelInfo **appinfos; int nappinfos; List *child_scanjoin_targets = NIL; - ListCell *lc; Assert(child_rel != NULL); |