1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Remove un-needed braces around single statements.

This commit is contained in:
Bruce Momjian
1998-06-15 19:30:31 +00:00
parent 27db9ecd0b
commit 6bd323c6b3
224 changed files with 221 additions and 2504 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.16 1998/02/26 04:33:11 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.17 1998/06/15 19:28:47 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -332,13 +332,9 @@ pull_constant_clauses(List *quals, List **constantQual)
foreach(q, quals)
{
if (!contain_var_clause(lfirst(q)))
{
constqual = lcons(lfirst(q), constqual);
}
else
{
restqual = lcons(lfirst(q), restqual);
}
}
freeList(quals);
*constantQual = constqual;
@@ -371,9 +367,7 @@ clause_relids_vars(Node *clause, List **relids, List **vars)
List *vi;
if (!intMember(var->varno, varno_list))
{
varno_list = lappendi(varno_list, var->varno);
}
foreach(vi, var_list)
{
Var *in_list = (Var *) lfirst(vi);
@@ -410,9 +404,7 @@ NumRelids(Node *clause)
Var *var = (Var *) lfirst(i);
if (!intMember(var->varno, var_list))
{
var_list = lconsi(var->varno, var_list);
}
}
return (length(var_list));
@@ -497,14 +489,10 @@ qual_clause_p(Node *clause)
/* How about Param-s ? - vadim 02/03/98 */
if (IsA(get_leftop((Expr *) clause), Var) &&
IsA(get_rightop((Expr *) clause), Const))
{
return (true);
}
else if (IsA(get_rightop((Expr *) clause), Var) &&
IsA(get_leftop((Expr *) clause), Const))
{
return (true);
}
return (false);
}
@@ -519,17 +507,11 @@ void
fix_opid(Node *clause)
{
if (clause == NULL || single_node(clause))
{
;
}
else if (or_clause(clause) || and_clause(clause))
{
fix_opids(((Expr *) clause)->args);
}
else if (is_funcclause(clause))
{
fix_opids(((Expr *) clause)->args);
}
else if (IsA(clause, ArrayRef))
{
ArrayRef *aref = (ArrayRef *) clause;
@@ -540,9 +522,7 @@ fix_opid(Node *clause)
fix_opid(aref->refassgnexpr);
}
else if (not_clause(clause))
{
fix_opid((Node *) get_notclausearg((Expr *) clause));
}
else if (is_opclause(clause))
{
replace_opid((Oper *) ((Expr *) clause)->oper);
@@ -550,9 +530,7 @@ fix_opid(Node *clause)
fix_opid((Node *) get_rightop((Expr *) clause));
}
else if (agg_clause(clause))
{
fix_opid(((Aggreg *) clause)->target);
}
else if (is_subplan(clause) &&
((SubPlan *) ((Expr *) clause)->oper)->sublink->subLinkType != EXISTS_SUBLINK)
{

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.6 1998/02/26 04:33:13 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.7 1998/06/15 19:28:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,13 +36,9 @@ List *
find_relation_indices(Query *root, Rel *rel)
{
if (rel->indexed)
{
return (find_secondary_index(root, lfirsti(rel->relids)));
}
else
{
return (NIL);
}
}
/*

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.6 1998/02/26 04:33:18 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.7 1998/06/15 19:28:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -103,13 +103,9 @@ other_join_clause_var(Var *var, Expr *clause)
r = (Var *) get_rightop(clause);
if (var_equal(var, l))
{
retval = r;
}
else if (var_equal(var, r))
{
retval = l;
}
}
return (retval);

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.7 1998/02/26 04:33:20 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.8 1998/06/15 19:28:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -77,9 +77,7 @@ set_cheapest(Rel *parent_rel, List *pathlist)
Path *path = (Path *) lfirst(p);
if (path_is_cheaper(path, cheapest_so_far))
{
cheapest_so_far = path;
}
}
parent_rel->cheapestpath = cheapest_so_far;
@@ -129,9 +127,7 @@ add_pathlist(Rel *parent_rel, List *unique_paths, List *new_paths)
{ /* (IsA(old_path,Path)) { */
new_path->parent = parent_rel;
if (!parent_rel->pruneable)
{
unique_paths = lcons(new_path, unique_paths);
}
else
unique_paths = lcons(new_path,
LispRemove(old_path, unique_paths));
@@ -180,16 +176,12 @@ better_path(Path *new_path, List *unique_paths, bool *noOther)
}
if (old_path == NULL)
{
*noOther = true;
}
else
{
*noOther = false;
if (path_is_cheaper(new_path, old_path))
{
retval = old_path;
}
}
return (retval);
@@ -299,14 +291,10 @@ create_index_path(Query *root,
* if no index keys were found, we can't order the path).
*/
if (pathnode->path.keys == NULL)
{
pathnode->path.p_ordering.ord.sortop = NULL;
}
}
else
{
pathnode->path.keys = NULL;
}
if (is_join_scan || restriction_clauses == NULL)
{
@@ -468,9 +456,7 @@ create_nestloop_path(Rel *joinrel,
/* add in expensive function costs -- JMH 7/7/92 */
#if 0
if (XfuncMode != XFUNC_OFF)
{
pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
}
#endif
return (pathnode);
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.16 1998/02/26 04:33:21 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.17 1998/06/15 19:28:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -282,27 +282,19 @@ index_selectivity(Oid indid,
i = 0;
foreach(xopno, opnos)
{
opno_array[i++] = lfirsti(xopno);
}
i = 0;
foreach(xattno, attnos)
{
attno_array[i++] = lfirsti(xattno);
}
i = 0;
foreach(value, values)
{
value_array[i++] = (char *) lfirst(value);
}
i = 0;
foreach(flag, flags)
{
flag_array[i++] = lfirsti(flag);
}
IndexSelectivity(indid,
relid,

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.12 1998/02/26 04:33:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.13 1998/06/15 19:28:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -385,9 +385,7 @@ flatten_tlist(List *tlist)
temp_entry = lfirst(temp);
vars = pull_var_clause((Node *) get_expr(temp_entry));
if (vars != NULL)
{
tlist_vars = nconc(tlist_vars, vars);
}
}
foreach(temp, tlist_vars)

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.11 1998/02/26 04:33:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.12 1998/06/15 19:28:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,9 +48,7 @@ pull_varnos(Node *me)
{
case T_List:
foreach(i, (List *) me)
{
result = nconc(result, pull_varnos(lfirst(i)));
}
break;
case T_ArrayRef:
foreach(i, ((ArrayRef *) me)->refupperindexpr)
@@ -182,9 +180,7 @@ pull_var_clause(Node *clause)
pull_var_clause(lfirst(((Expr *) lfirst(temp))->args)));
}
else if (IsA(clause, Aggreg))
{
retval = pull_var_clause(((Aggreg *) clause)->target);
}
else if (IsA(clause, ArrayRef))
{
List *temp;