From 38d103763d14baddf3cbfe4b00b501059fc9447f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 21 Feb 2017 11:33:07 -0500 Subject: Make more use of castNode() --- src/backend/optimizer/path/indxpath.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/backend/optimizer/path/indxpath.c') diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index d92826bcfc9..9c069983d91 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -1273,12 +1273,11 @@ generate_bitmap_or_paths(PlannerInfo *root, RelOptInfo *rel, foreach(lc, clauses) { - RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc); + RestrictInfo *rinfo = castNode(RestrictInfo, lfirst(lc)); List *pathlist; Path *bitmapqual; ListCell *j; - Assert(IsA(rinfo, RestrictInfo)); /* Ignore RestrictInfos that aren't ORs */ if (!restriction_is_or_clause(rinfo)) continue; @@ -1310,10 +1309,10 @@ generate_bitmap_or_paths(PlannerInfo *root, RelOptInfo *rel, } else { + RestrictInfo *rinfo = castNode(RestrictInfo, orarg); List *orargs; - Assert(IsA(orarg, RestrictInfo)); - Assert(!restriction_is_or_clause((RestrictInfo *) orarg)); + Assert(!restriction_is_or_clause(rinfo)); orargs = list_make1(orarg); indlist = build_paths_for_OR(root, rel, @@ -2174,9 +2173,8 @@ match_clauses_to_index(IndexOptInfo *index, foreach(lc, clauses) { - RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc); + RestrictInfo *rinfo = castNode(RestrictInfo, lfirst(lc)); - Assert(IsA(rinfo, RestrictInfo)); match_clause_to_index(index, rinfo, clauseset); } } -- cgit v1.2.3