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/path/indxpath.c | |
parent | 4e5ce3c1aeadf81b504bc9d683b67950bd3f8766 (diff) | |
download | postgresql-38d103763d14baddf3cbfe4b00b501059fc9447f.tar.gz postgresql-38d103763d14baddf3cbfe4b00b501059fc9447f.zip |
Make more use of castNode()
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 10 |
1 files changed, 4 insertions, 6 deletions
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); } } |