diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-02-21 11:33:07 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-02-21 11:59:09 -0500 |
commit | 38d103763d14baddf3cbfe4b00b501059fc9447f (patch) | |
tree | a69106fc39af0e181307f40fd3ba43b1930c3fcc /src/backend/optimizer/plan/subselect.c | |
parent | 4e5ce3c1aeadf81b504bc9d683b67950bd3f8766 (diff) |
Make more use of castNode()
Diffstat (limited to 'src/backend/optimizer/plan/subselect.c')
-rw-r--r-- | src/backend/optimizer/plan/subselect.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index 7954c445dd9..3eb2bb749e4 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -433,9 +433,8 @@ get_first_col_type(Plan *plan, Oid *coltype, int32 *coltypmod, /* In cases such as EXISTS, tlist might be empty; arbitrarily use VOID */ if (plan->targetlist) { - TargetEntry *tent = (TargetEntry *) linitial(plan->targetlist); + TargetEntry *tent = castNode(TargetEntry, linitial(plan->targetlist)); - Assert(IsA(tent, TargetEntry)); if (!tent->resjunk) { *coltype = exprType((Node *) tent->expr); @@ -601,14 +600,14 @@ make_subplan(PlannerInfo *root, Query *orig_subquery, AlternativeSubPlan *asplan; /* OK, convert to SubPlan format. */ - hashplan = (SubPlan *) build_subplan(root, plan, subroot, - plan_params, - ANY_SUBLINK, 0, - newtestexpr, - false, true, - best_path->parallel_safe); + hashplan = castNode(SubPlan, + build_subplan(root, plan, subroot, + plan_params, + ANY_SUBLINK, 0, + newtestexpr, + false, true, + best_path->parallel_safe)); /* Check we got what we expected */ - Assert(IsA(hashplan, SubPlan)); Assert(hashplan->parParam == NIL); Assert(hashplan->useHashTable); /* build_subplan won't have filled in paramIds */ |