mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Remove un-needed braces around single statements.
This commit is contained in:
16
src/backend/utils/cache/catcache.c
vendored
16
src/backend/utils/cache/catcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.28 1998/06/15 18:39:40 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.29 1998/06/15 19:29:38 momjian Exp $
|
||||
*
|
||||
* Notes:
|
||||
* XXX This needs to use exception.h to handle recovery when
|
||||
@ -172,9 +172,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
|
||||
if (cp)
|
||||
relation = heap_open(cp->relationId);
|
||||
else
|
||||
{
|
||||
relation = heap_openr(cache->cc_relname);
|
||||
}
|
||||
|
||||
didopen = 1;
|
||||
}
|
||||
@ -325,9 +323,7 @@ comphash(long l, char *v)
|
||||
|
||||
i = 0;
|
||||
while (l--)
|
||||
{
|
||||
i += *v++;
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
|
||||
@ -643,9 +639,7 @@ SystemCacheRelationFlushed(Oid relId)
|
||||
for (cache = Caches; PointerIsValid(cache); cache = cache->cc_next)
|
||||
{
|
||||
if (cache->relationId == relId)
|
||||
{
|
||||
cache->relationId = InvalidOid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -769,15 +763,11 @@ InitSysCache(char *relname,
|
||||
{
|
||||
cp->cc_key[i] = key[i];
|
||||
if (!key[i])
|
||||
{
|
||||
elog(FATAL, "InitSysCache: called with 0 key[%d]", i);
|
||||
}
|
||||
if (key[i] < 0)
|
||||
{
|
||||
if (key[i] != ObjectIdAttributeNumber)
|
||||
{
|
||||
elog(FATAL, "InitSysCache: called with %d key[%d]", key[i], i);
|
||||
}
|
||||
else
|
||||
{
|
||||
cp->cc_klen[i] = sizeof(Oid);
|
||||
@ -990,9 +980,7 @@ SearchSysCache(struct catcache * cache,
|
||||
*/
|
||||
MemoryContextSwitchTo((MemoryContext) CacheCxt);
|
||||
if (HeapTupleIsValid(ntp))
|
||||
{
|
||||
ntp = heap_copytuple(ntp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1150,9 +1138,7 @@ RelationInvalidateCatalogCacheTuple(Relation relation,
|
||||
|
||||
/* OPT inline simplification of CatalogCacheIdInvalidate */
|
||||
if (!PointerIsValid(function))
|
||||
{
|
||||
function = CatalogCacheIdInvalidate;
|
||||
}
|
||||
|
||||
(*function) (ccp->id,
|
||||
CatalogCacheComputeTupleHashIndex(ccp, relation, tuple),
|
||||
|
6
src/backend/utils/cache/fcache.c
vendored
6
src/backend/utils/cache/fcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.11 1998/02/26 04:37:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.12 1998/06/15 19:29:39 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -288,9 +288,7 @@ init_fcache(Oid foid,
|
||||
retval->nargs = retval->func.fn_nargs;
|
||||
}
|
||||
else
|
||||
{
|
||||
retval->func.fn_addr = (func_ptr) NULL;
|
||||
}
|
||||
|
||||
|
||||
return (retval);
|
||||
@ -316,7 +314,5 @@ setFcache(Node *node, Oid foid, List *argList, ExprContext *econtext)
|
||||
fnode->func_fcache = fcache;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "init_fcache: node must be Oper or Func!");
|
||||
}
|
||||
}
|
||||
|
10
src/backend/utils/cache/inval.c
vendored
10
src/backend/utils/cache/inval.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.10 1998/02/23 17:43:23 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.11 1998/06/15 19:29:39 momjian Exp $
|
||||
*
|
||||
* Note - this code is real crufty...
|
||||
*
|
||||
@ -140,9 +140,7 @@ LocalInvalidInvalidate(LocalInvalid invalid, void (*function) ())
|
||||
&((InvalidationUserData *) invalid)->dataP[-1];
|
||||
|
||||
if (PointerIsValid(function))
|
||||
{
|
||||
(*function) ((Pointer) &entryDataP->userData);
|
||||
}
|
||||
|
||||
invalid = (Pointer) entryDataP->nextP;
|
||||
|
||||
@ -485,17 +483,11 @@ RelationInvalidateRelationCache(Relation relation,
|
||||
* ----------------
|
||||
*/
|
||||
if (relationId == MyRelationRelationId)
|
||||
{
|
||||
objectId = tuple->t_oid;
|
||||
}
|
||||
else if (relationId == MyAttributeRelationId)
|
||||
{
|
||||
objectId = ((AttributeTupleForm) GETSTRUCT(tuple))->attrelid;
|
||||
}
|
||||
else if (relationId == MyAMRelationId)
|
||||
{
|
||||
objectId = tuple->t_oid;
|
||||
}
|
||||
else if (relationId == MyAMOPRelationId)
|
||||
{
|
||||
; /* objectId is unused */
|
||||
|
4
src/backend/utils/cache/lsyscache.c
vendored
4
src/backend/utils/cache/lsyscache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.13 1998/02/26 04:37:30 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.14 1998/06/15 19:29:40 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Eventually, the index information should go through here, too.
|
||||
@ -251,9 +251,7 @@ op_mergesortable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
18
src/backend/utils/cache/relcache.c
vendored
18
src/backend/utils/cache/relcache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.39 1998/06/15 18:39:40 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.40 1998/06/15 19:29:40 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -380,9 +380,7 @@ scan_pg_rel_seq(RelationBuildDescInfo buildinfo)
|
||||
* ----------------
|
||||
*/
|
||||
if (!HeapTupleIsValid(pg_class_tuple))
|
||||
{
|
||||
return_tuple = pg_class_tuple;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ------------------
|
||||
@ -907,13 +905,9 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo)
|
||||
* ----------------
|
||||
*/
|
||||
if (relp->relhasrules)
|
||||
{
|
||||
RelationBuildRuleLock(relation);
|
||||
}
|
||||
else
|
||||
{
|
||||
relation->rd_rules = NULL;
|
||||
}
|
||||
|
||||
/* Triggers */
|
||||
if (relp->reltriggers > 0)
|
||||
@ -926,9 +920,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo)
|
||||
* ----------------
|
||||
*/
|
||||
if (OidIsValid(relam))
|
||||
{
|
||||
IndexedAccessMethodInitialize(relation);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* initialize the relation lock manager information
|
||||
@ -993,9 +985,7 @@ IndexedAccessMethodInitialize(Relation relation)
|
||||
support = (RegProcedure *) palloc(supportSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
support = (RegProcedure *) NULL;
|
||||
}
|
||||
|
||||
IndexSupportInitialize(strategy, support,
|
||||
relation->rd_att->attrs[0]->attrelid,
|
||||
@ -1346,9 +1336,7 @@ RelationFlushRelation(Relation *relationPtr,
|
||||
int j;
|
||||
|
||||
for (j = 0; j < relation->rd_rules->numLocks; j++)
|
||||
{
|
||||
pfree(relation->rd_rules->rules[j]);
|
||||
}
|
||||
pfree(relation->rd_rules->rules);
|
||||
pfree(relation->rd_rules);
|
||||
}
|
||||
@ -1460,9 +1448,7 @@ RelationFlushIndexes(Relation *r,
|
||||
if (relation->rd_rel->relkind == RELKIND_INDEX && /* XXX style */
|
||||
(!OidIsValid(accessMethodId) ||
|
||||
relation->rd_rel->relam == accessMethodId))
|
||||
{
|
||||
RelationFlushRelation(&relation, false);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -1588,9 +1574,7 @@ RelationPurgeLocalRelation(bool xactCommitted)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
smgrunlink(DEFAULT_SMGR, reln);
|
||||
}
|
||||
}
|
||||
else if (!IsBootstrapProcessingMode() && !(reln->rd_istemp))
|
||||
|
||||
|
44
src/backend/utils/cache/syscache.c
vendored
44
src/backend/utils/cache/syscache.c
vendored
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.17 1998/05/09 23:45:29 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.18 1998/06/15 19:29:40 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These routines allow the parser/planner/executor to perform
|
||||
@ -406,30 +406,22 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
|
||||
return ((HeapTuple) NULL);
|
||||
}
|
||||
|
||||
if (!AMI_OVERRIDE)
|
||||
{
|
||||
Assert(PointerIsValid(SysCache[cacheId]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
{
|
||||
SysCache[cacheId] =
|
||||
InitSysCache(cacheinfo[cacheId].name,
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
{
|
||||
elog(ERROR,
|
||||
"InitCatalogCache: Can't init cache %.16s(%d)",
|
||||
cacheinfo[cacheId].name,
|
||||
cacheId);
|
||||
}
|
||||
Assert(AMI_OVERRIDE || PointerIsValid(SysCache[cacheId]));
|
||||
|
||||
}
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
{
|
||||
SysCache[cacheId] =
|
||||
InitSysCache(cacheinfo[cacheId].name,
|
||||
cacheinfo[cacheId].indname,
|
||||
cacheId,
|
||||
cacheinfo[cacheId].nkeys,
|
||||
cacheinfo[cacheId].key,
|
||||
cacheinfo[cacheId].iScanFunc);
|
||||
if (!PointerIsValid(SysCache[cacheId]))
|
||||
elog(ERROR,
|
||||
"InitCatalogCache: Can't init cache %.16s(%d)",
|
||||
cacheinfo[cacheId].name,
|
||||
cacheId);
|
||||
}
|
||||
|
||||
tp = SearchSysCache(SysCache[cacheId], key1, key2, key3, key4);
|
||||
@ -559,9 +551,7 @@ SearchSysCacheGetAttribute(int cacheId,
|
||||
}
|
||||
|
||||
if (attributeByValue)
|
||||
{
|
||||
returnValue = (void *) attributeValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *tmp;
|
||||
@ -662,9 +652,7 @@ TypeDefaultRetrieve(Oid typId)
|
||||
returnValue = (void *) i32;
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user