diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-06-15 19:30:31 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-06-15 19:30:31 +0000 |
commit | 6bd323c6b3f65b26273d5efb7ddd0ac04d039546 (patch) | |
tree | 6106db4e7512e765ca8c48963fb750cb63fec96f /src/backend/access | |
parent | 27db9ecd0b15abca733a99dab3bf9771ad70507d (diff) | |
download | postgresql-6bd323c6b3f65b26273d5efb7ddd0ac04d039546.tar.gz postgresql-6bd323c6b3f65b26273d5efb7ddd0ac04d039546.zip |
Remove un-needed braces around single statements.
Diffstat (limited to 'src/backend/access')
25 files changed, 22 insertions, 350 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index ded94d0d8a3..ec5b756e748 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.37 1998/02/26 04:29:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.38 1998/06/15 19:27:44 momjian Exp $ * * NOTES * The old interface functions have been converted to macros @@ -143,9 +143,7 @@ DataFill(char *data, if (bit != NULL) { if (bitmask != CSIGNBIT) - { bitmask <<= 1; - } else { bitP += 1; @@ -167,13 +165,9 @@ DataFill(char *data, case -1: *infomask |= HEAP_HASVARLENA; if (att[i]->attalign == 'd') - { data = (char *) DOUBLEALIGN(data); - } else - { data = (char *) INTALIGN(data); - } data_length = VARSIZE(DatumGetPointer(value[i])); memmove(data, DatumGetPointer(value[i]), data_length); data += data_length; @@ -239,9 +233,7 @@ heap_attisnull(HeapTuple tup, int attnum) return (0); if (attnum > 0) - { return (att_isnull(attnum - 1, tup->t_bits)); - } else switch (attnum) { @@ -513,9 +505,7 @@ nocachegetattr(HeapTuple tup, tp + att[attnum]->attcacheoff); } else if (attnum == 0) - { return ((Datum) fetchatt(&(att[0]), (char *) tp)); - } else if (!HeapTupleAllFixed(tup)) { int j = 0; diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c index 521dda8d81b..181f362d94f 100644 --- a/src/backend/access/common/indextuple.c +++ b/src/backend/access/common/indextuple.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.28 1998/02/26 04:29:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.29 1998/06/15 19:27:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -178,9 +178,7 @@ nocache_index_getattr(IndexTuple tup, /* first attribute is always at position zero */ if (attnum == 1) - { return (Datum) fetchatt(&(att[0]), (char *) tup + data_off); - } if (att[attnum]->attcacheoff != -1) { return (Datum) fetchatt(&(att[attnum]), @@ -260,9 +258,7 @@ nocache_index_getattr(IndexTuple tup, tp + att[attnum]->attcacheoff); } else if (attnum == 0) - { return ((Datum) fetchatt(&(att[0]), (char *) tp)); - } else if (!IndexTupleAllFixed(tup)) { int j = 0; @@ -482,9 +478,7 @@ CopyIndexTuple(IndexTuple source, IndexTuple *target) size = IndexTupleSize(source); if (*target == NULL) - { *target = (IndexTuple) palloc(size); - } ret = *target; memmove((char *) ret, (char *) source, size); diff --git a/src/backend/access/common/indexvalid.c b/src/backend/access/common/indexvalid.c index c39cce4751a..b19b35c923d 100644 --- a/src/backend/access/common/indexvalid.c +++ b/src/backend/access/common/indexvalid.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.18 1998/01/31 05:54:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.19 1998/06/15 19:27:45 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -61,9 +61,7 @@ index_keytest(IndexTuple tuple, } if (key[0].sk_flags & SK_ISNULL) - { return (false); - } if (key[0].sk_flags & SK_COMMUTE) { @@ -79,9 +77,7 @@ index_keytest(IndexTuple tuple, } if (!test == !(key[0].sk_flags & SK_NEGATE)) - { return (false); - } scanKeySize -= 1; key++; diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index 5711d18dff3..39b6ebeb72a 100644 --- a/src/backend/access/common/tupdesc.c +++ b/src/backend/access/common/tupdesc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.39 1998/04/26 04:05:02 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.40 1998/06/15 19:27:45 momjian Exp $ * * NOTES * some of the executor utility code such as "ExecTypeFromTL" should be @@ -508,9 +508,7 @@ BuildDescForRelation(List *schema, char *relname) * ---------------- */ if (!strcmp(typename, relname)) - { TupleDescMakeSelfReference(desc, attnum, relname); - } else elog(ERROR, "DefineRelation: no such type %s", typename); diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index a510dc8b203..dc2b57d4df2 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -632,9 +632,7 @@ gistAdjustKeys(Relation r, pfree(datum); } else - { ReleaseBuffer(b); - } pfree(evec); } @@ -834,9 +832,7 @@ gistSplit(Relation r, } if ((bufblock = BufferGetBlockNumber(buffer)) != GISTP_ROOT) - { PageRestoreTempPage(left, p); - } WriteBuffer(leftbuf); WriteBuffer(rightbuf); diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index de250987755..3832254af0b 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -52,13 +52,9 @@ gistgettuple(IndexScanDesc s, ScanDirection dir) /* not cached, so we'll have to do some work */ if (ItemPointerIsValid(&(s->currentItemData))) - { res = gistnext(s, dir); - } else - { res = gistfirst(s, dir); - } return (res); } @@ -103,13 +99,9 @@ gistfirst(IndexScanDesc s, ScanDirection dir) maxoff = PageGetMaxOffsetNumber(p); if (ScanDirectionIsBackward(dir)) - { n = OffsetNumberPrev(stk->gs_child); - } else - { n = OffsetNumberNext(stk->gs_child); - } so->s_stack = stk->gs_parent; pfree(stk); @@ -163,13 +155,9 @@ gistnext(IndexScanDesc s, ScanDirection dir) n = ItemPointerGetOffsetNumber(&(s->currentItemData)); if (ScanDirectionIsForward(dir)) - { n = OffsetNumberNext(n); - } else - { n = OffsetNumberPrev(n); - } b = ReadBuffer(s->relation, blk); p = BufferGetPage(b); @@ -195,13 +183,9 @@ gistnext(IndexScanDesc s, ScanDirection dir) po = (GISTPageOpaque) PageGetSpecialPointer(p); if (ScanDirectionIsBackward(dir)) - { n = OffsetNumberPrev(stk->gs_child); - } else - { n = OffsetNumberNext(stk->gs_child); - } so->s_stack = stk->gs_parent; pfree(stk); @@ -235,13 +219,9 @@ gistnext(IndexScanDesc s, ScanDirection dir) po = (GISTPageOpaque) PageGetSpecialPointer(p); if (ScanDirectionIsBackward(dir)) - { n = PageGetMaxOffsetNumber(p); - } else - { n = FirstOffsetNumber; - } } } } @@ -296,9 +276,7 @@ gistindex_keytest(IndexTuple tuple, } if (!test == !(key[0].sk_flags & SK_NEGATE)) - { return (false); - } scanKeySize -= 1; key++; @@ -343,13 +321,9 @@ gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir) break; if (ScanDirectionIsBackward(dir)) - { n = OffsetNumberPrev(n); - } else - { n = OffsetNumberNext(n); - } } return (n); @@ -405,9 +379,7 @@ gistheapptr(Relation r, ItemPointer itemp) ReleaseBuffer(b); } else - { ItemPointerSetInvalid(ip); - } return (ip); } diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c index e5fa6b44a2d..7b9d49726ba 100644 --- a/src/backend/access/gist/gistscan.c +++ b/src/backend/access/gist/gistscan.c @@ -102,17 +102,11 @@ gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key) * Set flags. */ if (RelationGetNumberOfBlocks(s->relation) == 0) - { s->flags = ScanUnmarked; - } else if (fromEnd) - { s->flags = ScanUnmarked | ScanUncheckedPrevious; - } else - { s->flags = ScanUnmarked | ScanUncheckedNext; - } s->scanFromEnd = fromEnd; @@ -276,9 +270,7 @@ gistdropscan(IndexScanDesc s) for (l = GISTScans; l != (GISTScanList) NULL && l->gsl_scan != s; l = l->gsl_next) - { prev = l; - } if (l == (GISTScanList) NULL) elog(ERROR, "GiST scan list corrupted -- cannot find 0x%lx", s); diff --git a/src/backend/access/hash/hashinsert.c b/src/backend/access/hash/hashinsert.c index c72a5e6c1f8..8e70e456637 100644 --- a/src/backend/access/hash/hashinsert.c +++ b/src/backend/access/hash/hashinsert.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.12 1998/01/07 21:00:56 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.13 1998/06/15 19:27:48 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -204,9 +204,7 @@ _hash_insertonpg(Relation rel, if (do_expand || (metap->hashm_nkeys / (metap->hashm_maxbucket + 1)) > metap->hashm_ffactor) - { _hash_expandtable(rel, metabuf); - } _hash_relbuf(rel, metabuf, HASH_READ); return (res); } diff --git a/src/backend/access/hash/hashovfl.c b/src/backend/access/hash/hashovfl.c index 363d79a7462..54178179162 100644 --- a/src/backend/access/hash/hashovfl.c +++ b/src/backend/access/hash/hashovfl.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.15 1998/01/07 21:01:00 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.16 1998/06/15 19:27:49 momjian Exp $ * * NOTES * Overflow pages look like ordinary relation pages. @@ -64,9 +64,7 @@ _hash_addovflpage(Relation rel, Buffer *metabufp, Buffer buf) /* allocate an empty overflow page */ oaddr = _hash_getovfladdr(rel, metabufp); if (oaddr == InvalidOvflAddress) - { elog(ERROR, "_hash_addovflpage: problem with _hash_getovfladdr."); - } ovflblkno = OADDR_TO_BLKNO(OADDR_OF(SPLITNUM(oaddr), OPAGENUM(oaddr))); Assert(BlockNumberIsValid(ovflblkno)); ovflbuf = _hash_getbuf(rel, ovflblkno, HASH_WRITE); @@ -171,9 +169,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp) if (offset > SPLITMASK) { if (++splitnum >= NCACHED) - { elog(ERROR, OVMSG); - } metap->OVFL_POINT = splitnum; metap->SPARES[splitnum] = metap->SPARES[splitnum - 1]; metap->SPARES[splitnum - 1]--; @@ -189,9 +185,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp) free_page++; if (free_page >= NCACHED) - { elog(ERROR, OVMSG); - } /* * This is tricky. The 1 indicates that you want the new page @@ -205,17 +199,13 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp) */ if (_hash_initbitmap(rel, metap, OADDR_OF(splitnum, offset), 1, free_page)) - { elog(ERROR, "overflow_page: problem with _hash_initbitmap."); - } metap->SPARES[splitnum]++; offset++; if (offset > SPLITMASK) { if (++splitnum >= NCACHED) - { elog(ERROR, OVMSG); - } metap->OVFL_POINT = splitnum; metap->SPARES[splitnum] = metap->SPARES[splitnum - 1]; metap->SPARES[splitnum - 1]--; @@ -252,18 +242,14 @@ found: bit = 1 + bit + (i * BMPGSZ_BIT(metap)); if (bit >= metap->LAST_FREED) - { metap->LAST_FREED = bit - 1; - } /* Calculate the split number for this page */ for (i = 0; (i < splitnum) && (bit > metap->SPARES[i]); i++) ; offset = (i ? bit - metap->SPARES[i - 1] : bit); if (offset >= SPLITMASK) - { elog(ERROR, OVMSG); - } /* initialize this page */ oaddr = OADDR_OF(i, offset); @@ -381,9 +367,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf) (splitnum ? metap->SPARES[splitnum - 1] : 0) + (addr & SPLITMASK) - 1; if (ovflpgno < metap->LAST_FREED) - { metap->LAST_FREED = ovflpgno; - } bitmappage = (ovflpgno >> (metap->BSHIFT + BYTE_TO_BIT)); bitmapbit = ovflpgno & (BMPGSZ_BIT(metap) - 1); @@ -403,13 +387,9 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf) * return that buffer with a write lock. */ if (BlockNumberIsValid(nextblkno)) - { return (_hash_getbuf(rel, nextblkno, HASH_WRITE)); - } else - { return (InvalidBuffer); - } } @@ -543,9 +523,7 @@ _hash_squeezebucket(Relation rel, { rblkno = ropaque->hasho_nextblkno; if (ropaque != wopaque) - { _hash_relbuf(rel, rbuf, HASH_WRITE); - } rbuf = _hash_getbuf(rel, rblkno, HASH_WRITE); rpage = BufferGetPage(rbuf); _hash_checkpage(rpage, LH_OVERFLOW_PAGE); @@ -621,9 +599,7 @@ _hash_squeezebucket(Relation rel, */ rbuf = _hash_freeovflpage(rel, rbuf); if (BufferIsValid(rbuf)) - { _hash_relbuf(rel, rbuf, HASH_WRITE); - } if (rblkno == wblkno) { diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c index 8773e46c4bf..ebac11ed12e 100644 --- a/src/backend/access/hash/hashpage.c +++ b/src/backend/access/hash/hashpage.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.15 1998/01/07 21:01:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.16 1998/06/15 19:27:49 momjian Exp $ * * NOTES * Postgres hash pages look like ordinary relation pages. The opaque @@ -106,9 +106,7 @@ _hash_metapinit(Relation rel) if ((1 << i) < (metap->hashm_bsize - (DOUBLEALIGN(sizeof(PageHeaderData)) + DOUBLEALIGN(sizeof(HashPageOpaqueData))))) - { break; - } } Assert(i); metap->hashm_bmsize = 1 << i; @@ -191,9 +189,7 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access) Buffer buf; if (blkno == P_NEW) - { elog(ERROR, "_hash_getbuf: internal error: hash AM does not use P_NEW"); - } switch (access) { case HASH_WRITE: @@ -395,14 +391,10 @@ _hash_pagedel(Relation rel, ItemPointer tid) { buf = _hash_freeovflpage(rel, buf); if (BufferIsValid(buf)) - { _hash_relbuf(rel, buf, HASH_WRITE); - } } else - { _hash_relbuf(rel, buf, HASH_WRITE); - } metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_WRITE); metap = (HashMetaPage) BufferGetPage(metabuf); @@ -545,9 +537,7 @@ _hash_splitpage(Relation rel, opage = BufferGetPage(obuf); _hash_checkpage(opage, LH_OVERFLOW_PAGE); if (PageIsEmpty(opage)) - { elog(ERROR, "_hash_splitpage: empty overflow page %d", oblkno); - } oopaque = (HashPageOpaque) PageGetSpecialPointer(opage); } diff --git a/src/backend/access/hash/hashscan.c b/src/backend/access/hash/hashscan.c index 848f8d9e1b4..708dc18943e 100644 --- a/src/backend/access/hash/hashscan.c +++ b/src/backend/access/hash/hashscan.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.13 1998/01/07 21:01:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.14 1998/06/15 19:27:50 momjian Exp $ * * NOTES * Because we can be doing an index scan on a relation while we @@ -71,9 +71,7 @@ _hash_dropscan(IndexScanDesc scan) for (chk = HashScans; chk != (HashScanList) NULL && chk->hashsl_scan != scan; chk = chk->hashsl_next) - { last = chk; - } if (chk == (HashScanList) NULL) elog(ERROR, "hash scan list trashed; can't find 0x%lx", scan); diff --git a/src/backend/access/hash/hashsearch.c b/src/backend/access/hash/hashsearch.c index 0ebb301c877..a3d56190605 100644 --- a/src/backend/access/hash/hashsearch.c +++ b/src/backend/access/hash/hashsearch.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.14 1997/09/08 21:40:52 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.15 1998/06/15 19:27:50 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -49,9 +49,7 @@ _hash_search(Relation rel, bucket = 0; } else - { bucket = _hash_call(rel, metap, keyDatum); - } blkno = BUCKET_TO_BLKNO(bucket); @@ -109,9 +107,7 @@ _hash_next(IndexScanDesc scan, ScanDirection dir) * next tuple, we come back with a lock on that buffer. */ if (!_hash_step(scan, &buf, dir, metabuf)) - { return ((RetrieveIndexResult) NULL); - } /* if we're here, _hash_step found a valid tuple */ current = &(scan->currentItemData); @@ -225,9 +221,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir) if (PageIsEmpty(page)) { if (BlockNumberIsValid(opaque->hasho_nextblkno)) - { _hash_readnext(rel, &buf, &page, &opaque); - } else { ItemPointerSetInvalid(current); @@ -249,15 +243,11 @@ _hash_first(IndexScanDesc scan, ScanDirection dir) if (ScanDirectionIsBackward(dir)) { while (BlockNumberIsValid(opaque->hasho_nextblkno)) - { _hash_readnext(rel, &buf, &page, &opaque); - } } if (!_hash_step(scan, &buf, dir, metabuf)) - { return ((RetrieveIndexResult) NULL); - } /* if we're here, _hash_step found a valid tuple */ current = &(scan->currentItemData); @@ -321,13 +311,9 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf) */ maxoff = PageGetMaxOffsetNumber(page); if (ItemPointerIsValid(current)) - { offnum = ItemPointerGetOffsetNumber(current); - } else - { offnum = InvalidOffsetNumber; - } /* * 'offnum' now points to the last tuple we have seen (if any). @@ -371,9 +357,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf) Assert(opaque->hasho_bucket == bucket); while (PageIsEmpty(page) && BlockNumberIsValid(opaque->hasho_nextblkno)) - { _hash_readnext(rel, &buf, &page, &opaque); - } maxoff = PageGetMaxOffsetNumber(page); offnum = FirstOffsetNumber; } @@ -420,9 +404,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf) opaque = (HashPageOpaque) PageGetSpecialPointer(page); Assert(opaque->hasho_bucket == bucket); while (BlockNumberIsValid(opaque->hasho_nextblkno)) - { _hash_readnext(rel, &buf, &page, &opaque); - } maxoff = offnum = PageGetMaxOffsetNumber(page); } else diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 6bb6f387181..d246f79151b 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.27 1998/02/26 04:29:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.28 1998/06/15 19:27:51 momjian Exp $ * * * INTERFACE ROUTINES @@ -168,9 +168,7 @@ static void unpinsdesc(HeapScanDesc sdesc) { if (BufferIsValid(sdesc->rs_pbuf)) - { ReleaseBuffer(sdesc->rs_pbuf); - } /* ------------------------------------ * Scan will pin buffer one for each non-NULL tuple pointer @@ -179,14 +177,10 @@ unpinsdesc(HeapScanDesc sdesc) * ------------------------------------ */ if (BufferIsValid(sdesc->rs_cbuf)) - { ReleaseBuffer(sdesc->rs_cbuf); - } if (BufferIsValid(sdesc->rs_nbuf)) - { ReleaseBuffer(sdesc->rs_nbuf); - } } /* ------------------------------------------ @@ -262,9 +256,7 @@ heapgettup(Relation relation, #endif /* !defined(HEAPDEBUGALL) */ if (!ItemPointerIsValid(tid)) - { Assert(!PointerIsValid(tid)); - } /* ---------------- * return null immediately if relation is empty @@ -313,9 +305,7 @@ heapgettup(Relation relation, * ---------------- */ if (ItemPointerIsValid(tid) == false) - { tid = NULL; - } if (tid == NULL) { page = pages - 1; /* final page */ @@ -333,9 +323,7 @@ heapgettup(Relation relation, *b = RelationGetBufferWithBuffer(relation, page, *b); #ifndef NO_BUFFERISVALID if (!BufferIsValid(*b)) - { elog(ERROR, "heapgettup: failed ReadBuffer"); - } #endif dp = (Page) BufferGetPage(*b); @@ -380,9 +368,7 @@ heapgettup(Relation relation, *b = RelationGetBufferWithBuffer(relation, page, *b); #ifndef NO_BUFFERISVALID if (!BufferIsValid(*b)) - { elog(ERROR, "heapgettup: failed ReadBuffer"); - } #endif dp = (Page) BufferGetPage(*b); @@ -398,13 +384,9 @@ heapgettup(Relation relation, */ lpp = PageGetItemId(dp, lineoff); if (dir < 0) - { linesleft = lineoff - 1; - } else - { linesleft = lines - lineoff; - } /* ---------------- * advance the scan until we find a qualifying tuple or @@ -476,21 +458,15 @@ heapgettup(Relation relation, #ifndef NO_BUFFERISVALID if (!BufferIsValid(*b)) - { elog(ERROR, "heapgettup: failed ReadBuffer"); - } #endif dp = (Page) BufferGetPage(*b); lines = lineoff = PageGetMaxOffsetNumber((Page) dp); linesleft = lines - 1; if (dir < 0) - { lpp = PageGetItemId(dp, lineoff); - } else - { lpp = PageGetItemId(dp, FirstOffsetNumber); - } } } @@ -544,9 +520,7 @@ heap_open(Oid relationId) r = (Relation) RelationIdGetRelation(relationId); if (RelationIsValid(r) && r->rd_rel->relkind == RELKIND_INDEX) - { elog(ERROR, "%s is an index relation", r->rd_rel->relname.data); - } return (r); } @@ -573,9 +547,7 @@ heap_openr(char *relationName) r = RelationNameGetRelation(relationName); if (RelationIsValid(r) && r->rd_rel->relkind == RELKIND_INDEX) - { elog(ERROR, "%s is an index relation", r->rd_rel->relname.data); - } return (r); } @@ -1094,9 +1066,7 @@ heap_fetch(Relation relation, */ if (PointerIsValid(b)) - { *b = buffer; - } else { tuple = heap_copytuple(tuple); @@ -1402,9 +1372,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup) * ---------------- */ if ((unsigned) DOUBLEALIGN(tup->t_len) <= PageGetFreeSpace((Page) dp)) - { RelationPutHeapTuple(relation, BufferGetBlockNumber(buffer), tup); - } else { /* ---------------- @@ -1500,29 +1468,17 @@ heap_markpos(HeapScanDesc sdesc) * ---------------- */ if (sdesc->rs_ptup != NULL) - { sdesc->rs_mptid = sdesc->rs_ptup->t_ctid; - } else - { ItemPointerSetInvalid(&sdesc->rs_mptid); - } if (sdesc->rs_ctup != NULL) - { sdesc->rs_mctid = sdesc->rs_ctup->t_ctid; - } else - { ItemPointerSetInvalid(&sdesc->rs_mctid); - } if (sdesc->rs_ntup != NULL) - { sdesc->rs_mntid = sdesc->rs_ntup->t_ctid; - } else - { ItemPointerSetInvalid(&sdesc->rs_mntid); - } } /* ---------------- @@ -1568,9 +1524,7 @@ heap_restrpos(HeapScanDesc sdesc) sdesc->rs_nbuf = InvalidBuffer; if (!ItemPointerIsValid(&sdesc->rs_mptid)) - { sdesc->rs_ptup = NULL; - } else { sdesc->rs_ptup = (HeapTuple) @@ -1584,9 +1538,7 @@ heap_restrpos(HeapScanDesc sdesc) } if (!ItemPointerIsValid(&sdesc->rs_mctid)) - { sdesc->rs_ctup = NULL; - } else { sdesc->rs_ctup = (HeapTuple) @@ -1600,9 +1552,7 @@ heap_restrpos(HeapScanDesc sdesc) } if (!ItemPointerIsValid(&sdesc->rs_mntid)) - { sdesc->rs_ntup = NULL; - } else { sdesc->rs_ntup = (HeapTuple) diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c index 7fc9607b441..229ca5d1a27 100644 --- a/src/backend/access/index/genam.c +++ b/src/backend/access/index/genam.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.11 1998/01/07 21:01:35 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.12 1998/06/15 19:27:53 momjian Exp $ * * NOTES * many of the old access method routines have been turned into @@ -117,13 +117,9 @@ RelationGetIndexScan(Relation relation, ItemPointerSetInvalid(&scan->nextMarkData); if (numberOfKeys > 0) - { scan->keyData = (ScanKey) palloc(sizeof(ScanKeyData) * numberOfKeys); - } else - { scan->keyData = NULL; - } index_rescan(scan, scanFromEnd, key); @@ -224,13 +220,9 @@ IndexScanMarkPosition(IndexScanDesc scan) index_getnext(scan, BackwardScanDirection); if (result != NULL) - { scan->previousItemData = result->index_iptr; - } else - { ItemPointerSetInvalid(&scan->previousItemData); - } } else if (scan->flags & ScanUncheckedNext) @@ -239,13 +231,9 @@ IndexScanMarkPosition(IndexScanDesc scan) index_getnext(scan, ForwardScanDirection); if (result != NULL) - { scan->nextItemData = result->index_iptr; - } else - { ItemPointerSetInvalid(&scan->nextItemData); - } } scan->previousMarkData = scan->previousItemData; diff --git a/src/backend/access/index/istrat.c b/src/backend/access/index/istrat.c index d7953a1cd8e..b0b0cdc452d 100644 --- a/src/backend/access/index/istrat.c +++ b/src/backend/access/index/istrat.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.19 1998/04/27 04:04:09 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.20 1998/06/15 19:27:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -309,9 +309,7 @@ RelationGetStrategy(Relation relation, for (index = 0; index < evaluation->maxStrategy; index += 1) { if (strategyMap->entry[index].sk_procedure == procedure) - { break; - } } if (index == evaluation->maxStrategy) @@ -347,9 +345,7 @@ RelationGetStrategy(Relation relation, if (!StrategyNumberIsInBounds(strategy, evaluation->maxStrategy)) { if (!StrategyNumberIsValid(strategy)) - { elog(ERROR, "RelationGetStrategy: corrupted evaluation"); - } } return strategy; @@ -465,9 +461,7 @@ RelationInvokeStrategy(Relation relation, (*termP)->operatorData[index].strategy); if (!RegProcedureIsValid(entry->sk_procedure)) - { break; - } } if (index == (*termP)->degree) @@ -582,9 +576,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, if (!OidIsValid(iform->indkey[attributeIndex])) { if (attributeIndex == 0) - { elog(ERROR, "IndexSupportInitialize: no pg_index tuple"); - } break; } @@ -621,9 +613,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy, loc = &indexSupport[((attributeNumber - 1) * maxSupportNumber)]; for (support = maxSupportNumber; --support >= 0;) - { loc[support] = InvalidOid; - } entry[1].sk_argument = ObjectIdGetDatum(operatorClassObjectId[attributeNumber - 1]); diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c index b00dae99a0c..350e198514b 100644 --- a/src/backend/access/nbtree/nbtinsert.c +++ b/src/backend/access/nbtree/nbtinsert.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.25 1998/01/15 19:42:10 pgsql Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.26 1998/06/15 19:27:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -127,9 +127,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel } /* get next offnum */ if (offset < maxoff) - { offset = OffsetNumberNext(offset); - } else { /* move right ? */ if (P_RIGHTMOST(opaque)) @@ -906,13 +904,9 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright) */ if (P_RIGHTMOST(ropaque)) - { itemid = PageGetItemId(rightpage, P_HIKEY); - } else - { itemid = PageGetItemId(rightpage, P_FIRSTKEY); - } itemsz = ItemIdGetLength(itemid); item = (BTItem) PageGetItem(rightpage, itemid); @@ -1178,9 +1172,7 @@ _bt_pgaddtup(Relation rel, first = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY; if (afteritem == (BTItem) NULL) - { itup_off = _bt_binsrch(rel, buf, keysz, itup_scankey, BT_INSERTION); - } else { itup_off = first; @@ -1358,9 +1350,7 @@ _bt_itemcmp(Relation rel, compare = (strat == BTLessStrategyNumber) ? true : false; } else - { compare = _bt_invokestrat(rel, i, strat, attrDatum1, attrDatum2); - } if (compare) /* true for one of ">, <, =" */ { @@ -1430,9 +1420,7 @@ _bt_updateitem(Relation rel, /* this should never happen (in theory) */ if (!BTItemSame(item, oldItem)) - { elog(FATAL, "_bt_getstackbuf was lying!!"); - } /* * It's defined by caller (_bt_insertonpg) diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 72e0731edd3..b4d1185a601 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.25 1998/02/26 04:29:44 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.26 1998/06/15 19:27:56 momjian Exp $ * * NOTES * This file contains only the public interface routines. @@ -267,20 +267,14 @@ btbuild(Relation heap, * into the btree. */ if (usefast) - { _bt_spool(index, btitem, spool); - } else - { res = _bt_doinsert(index, btitem, isunique, heap); - } pfree(btitem); pfree(itup); if (res) - { pfree(res); - } } /* okay, all heap tuples are indexed */ diff --git a/src/backend/access/nbtree/nbtscan.c b/src/backend/access/nbtree/nbtscan.c index a7ae57f91a8..8fc6e736c69 100644 --- a/src/backend/access/nbtree/nbtscan.c +++ b/src/backend/access/nbtree/nbtscan.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.13 1998/02/28 13:53:18 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.14 1998/06/15 19:27:57 momjian Exp $ * * * NOTES @@ -72,9 +72,7 @@ _bt_dropscan(IndexScanDesc scan) for (chk = BTScans; chk != (BTScanList) NULL && chk->btsl_scan != scan; chk = chk->btsl_next) - { last = chk; - } if (chk == (BTScanList) NULL) elog(ERROR, "btree scan list trashed; can't find 0x%lx", scan); diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c index d11874d56d2..633a310ea1a 100644 --- a/src/backend/access/nbtree/nbtsearch.c +++ b/src/backend/access/nbtree/nbtsearch.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.35 1998/05/13 03:44:23 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.36 1998/06/15 19:27:58 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -541,9 +541,7 @@ _bt_firsteq(Relation rel, while (offnum > limit && _bt_compare(rel, itupdesc, page, keysz, scankey, OffsetNumberPrev(offnum)) == 0) - { offnum = OffsetNumberPrev(offnum); - } return (offnum); } @@ -616,9 +614,7 @@ _bt_compare(Relation rel, * - see new comments above... */ if (!P_RIGHTMOST(opaque)) - { elog(ERROR, "_bt_compare: invalid comparison to high key"); - } #if 0 @@ -634,9 +630,7 @@ _bt_compare(Relation rel, if (_bt_skeycmp(rel, keysz, scankey, page, itemid, BTEqualStrategyNumber)) - { return (0); - } return (1); #endif } @@ -676,9 +670,7 @@ _bt_compare(Relation rel, tmpres = (long) -1; /* NOT_NULL "<" NULL */ } else - { tmpres = (long) FMGR_PTR2(&entry->sk_func, entry->sk_argument, datum); - } result = tmpres; /* if the keys are unequal, return the difference */ @@ -1090,9 +1082,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) if (ScanDirectionIsForward(dir)) { if (!PageIsEmpty(page) && offnum < maxoff) - { offnum = OffsetNumberNext(offnum); - } else { @@ -1119,9 +1109,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) start = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY; if (!PageIsEmpty(page) && start <= maxoff) - { break; - } else { blkno = opaque->btpo_next; @@ -1145,9 +1133,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) start = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY; if (offnum > start) - { offnum = OffsetNumberPrev(offnum); - } else { @@ -1196,9 +1182,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) /* anything to look at here? */ if (!PageIsEmpty(page) && maxoff >= start) - { break; - } else { blkno = opaque->btpo_prev; @@ -1278,13 +1262,9 @@ _bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir) /* if we've hit end of scan we don't have to do any work */ if (ScanDirectionIsForward(dir) && P_RIGHTMOST(opaque)) - { return (false); - } else if (ScanDirectionIsBackward(dir) && P_LEFTMOST(opaque)) - { return (false); - } /* * Okay, it's off the page; let _bt_step() do the hard work, and we'll @@ -1371,13 +1351,9 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir) break; if (ScanDirectionIsForward(dir)) - { offnum = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY; - } else - { offnum = PageGetMaxOffsetNumber(page); - } btitem = (BTItem) PageGetItem(page, PageGetItemId(page, offnum)); itup = &(btitem->bti_itup); @@ -1461,9 +1437,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir) } /* new stuff ends here */ else - { ItemPointerSet(current, blkno, start); - } } else if (ScanDirectionIsBackward(dir)) { @@ -1510,9 +1484,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir) } } else - { elog(ERROR, "Illegal scan direction %d", dir); - } btitem = (BTItem) PageGetItem(page, PageGetItemId(page, start)); itup = &(btitem->bti_itup); diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index b6f7b337a95..12effb71eb4 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -5,7 +5,7 @@ * * * IDENTIFICATION - * $Id: nbtsort.c,v 1.29 1998/02/26 04:29:54 momjian Exp $ + * $Id: nbtsort.c,v 1.30 1998/06/15 19:27:59 momjian Exp $ * * NOTES * @@ -288,9 +288,7 @@ _bt_pqsift(BTPriQueue *q, int parent) if (child < q->btpq_nelem - 1) { if (GREATER(&(q->btpq_queue[child]), &(q->btpq_queue[child + 1]))) - { ++child; - } } if (GREATER(&(q->btpq_queue[parent]), &(q->btpq_queue[child]))) { @@ -300,9 +298,7 @@ _bt_pqsift(BTPriQueue *q, int parent) parent = child; } else - { parent = child + 1; - } } } @@ -331,18 +327,14 @@ _bt_pqadd(BTPriQueue *q, BTPriQueueElem *e) parent; if (q->btpq_nelem >= MAXELEM) - { elog(ERROR, "_bt_pqadd: queue overflow"); - } child = q->btpq_nelem++; while (child > 0) { parent = child / 2; if (GREATER(e, &(q->btpq_queue[parent]))) - { break; - } else { q->btpq_queue[child] = q->btpq_queue[parent]; /* struct = */ @@ -424,9 +416,7 @@ _bt_tapecreate(char *fname) BTTapeBlock *tape = (BTTapeBlock *) palloc(sizeof(BTTapeBlock)); if (tape == (BTTapeBlock *) NULL) - { elog(ERROR, "_bt_tapecreate: out of memory"); - } tape->bttb_magic = BTTAPEMAGIC; @@ -516,9 +506,7 @@ _bt_tapenext(BTTapeBlock *tape, char **pos) BTItem bti; if (*pos >= tape->bttb_data + tape->bttb_top) - { return ((BTItem) NULL); - } bti = (BTItem) *pos; itemsz = BTITEMSZ(bti); *pos += DOUBLEALIGN(itemsz); @@ -561,9 +549,7 @@ _bt_spoolinit(Relation index, int ntapes, bool isunique) char *fname = (char *) palloc(sizeof(TAPETEMP) + 1); if (btspool == (BTSpool *) NULL || fname == (char *) NULL) - { elog(ERROR, "_bt_spoolinit: out of memory"); - } MemSet((char *) btspool, 0, sizeof(BTSpool)); btspool->bts_ntapes = ntapes; btspool->bts_tape = 0; @@ -575,9 +561,7 @@ _bt_spoolinit(Relation index, int ntapes, bool isunique) (BTTapeBlock **) palloc(sizeof(BTTapeBlock *) * ntapes); if (btspool->bts_itape == (BTTapeBlock **) NULL || btspool->bts_otape == (BTTapeBlock **) NULL) - { elog(ERROR, "_bt_spoolinit: out of memory"); - } for (i = 0; i < ntapes; ++i) { @@ -621,9 +605,7 @@ _bt_spoolflush(BTSpool *btspool) for (i = 0; i < btspool->bts_ntapes; ++i) { if (!EMPTYTAPE(btspool->bts_otape[i])) - { _bt_tapewrite(btspool->bts_otape[i], 1); - } } } @@ -716,9 +698,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool) (BTSortKey *) palloc(it_ntup * sizeof(BTSortKey)); pos = itape->bttb_data; for (i = 0; i < it_ntup; ++i) - { _bt_setsortkey(index, _bt_tapenext(itape, &pos), &(parray[i])); - } /* * qsort the pointer array. @@ -790,9 +770,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool) /* insert this item into the current buffer */ if (btitem != (BTItem) NULL) - { _bt_tapeadd(itape, btitem, itemsz); - } } /* @@ -1008,9 +986,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags) * shuffling). */ for (o = last_off; o > first_off; o = OffsetNumberPrev(o)) - { PageIndexTupleDelete(opage, o); - } hii = PageGetItemId(opage, P_HIKEY); ii = PageGetItemId(opage, first_off); *hii = *ii; @@ -1085,14 +1061,10 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags) #endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */ #endif if (last_bti == (BTItem) NULL) - { first_off = P_FIRSTKEY; - } else if (!_bt_itemcmp(index, _bt_nattr, bti, last_bti, BTEqualStrategyNumber)) - { first_off = off; - } last_off = off; last_bti = (BTItem) PageGetItem(npage, PageGetItemId(npage, off)); @@ -1226,9 +1198,7 @@ _bt_merge(Relation index, BTSpool *btspool) do { if (_bt_taperead(itape) == 0) - { tapedone[t] = 1; - } } while (!tapedone[t] && EMPTYTAPE(itape)); if (!tapedone[t]) { @@ -1237,9 +1207,7 @@ _bt_merge(Relation index, BTSpool *btspool) _bt_setsortkey(index, _bt_tapenext(itape, &tapepos[t]), &(e.btpqe_item)); if (e.btpqe_item.btsk_item != (BTItem) NULL) - { _bt_pqadd(&q, &e); - } } } @@ -1334,9 +1302,7 @@ _bt_merge(Relation index, BTSpool *btspool) do { if (_bt_taperead(itape) == 0) - { tapedone[t] = 1; - } } while (!tapedone[t] && EMPTYTAPE(itape)); if (!tapedone[t]) { @@ -1372,9 +1338,7 @@ _bt_merge(Relation index, BTSpool *btspool) * pages instead of merging into a tape file. */ if (nruns <= btspool->bts_ntapes) - { doleaf = true; - } } while (nruns > 0); /* pass */ _bt_uppershutdown(index, state); diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c index 652f1c69782..f4fd602898c 100644 --- a/src/backend/access/nbtree/nbtutils.c +++ b/src/backend/access/nbtree/nbtutils.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.19 1998/04/27 04:04:21 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.20 1998/06/15 19:27:59 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -157,9 +157,7 @@ _bt_orderkeys(Relation relation, BTScanOpaque so) if (i == numberOfKeys || cur->sk_attno != attno) { if (cur->sk_attno != attno + 1 && i < numberOfKeys) - { elog(ERROR, "_bt_orderkeys: key(s) for attribute %d missed", attno + 1); - } /* * If = has been specified, no other key will be used. In case @@ -373,9 +371,7 @@ _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok) /* btree doesn't support 'A is null' clauses, yet */ if (isNull || key[0].sk_flags & SK_ISNULL) - { return (false); - } if (key[0].sk_flags & SK_COMMUTE) { @@ -391,9 +387,7 @@ _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok) } if (!test == !(key[0].sk_flags & SK_NEGATE)) - { return (false); - } keysz -= 1; key++; diff --git a/src/backend/access/rtree/rtget.c b/src/backend/access/rtree/rtget.c index 6a13b81a1f9..eb9d43943ed 100644 --- a/src/backend/access/rtree/rtget.c +++ b/src/backend/access/rtree/rtget.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.9 1997/09/08 02:21:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.10 1998/06/15 19:28:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -47,13 +47,9 @@ rtgettuple(IndexScanDesc s, ScanDirection dir) /* not cached, so we'll have to do some work */ if (ItemPointerIsValid(&(s->currentItemData))) - { res = rtnext(s, dir); - } else - { res = rtfirst(s, dir); - } return (res); } @@ -98,13 +94,9 @@ rtfirst(IndexScanDesc s, ScanDirection dir) maxoff = PageGetMaxOffsetNumber(p); if (ScanDirectionIsBackward(dir)) - { n = OffsetNumberPrev(stk->rts_child); - } else - { n = OffsetNumberNext(stk->rts_child); - } so->s_stack = stk->rts_parent; pfree(stk); @@ -158,13 +150,9 @@ rtnext(IndexScanDesc s, ScanDirection dir) n = ItemPointerGetOffsetNumber(&(s->currentItemData)); if (ScanDirectionIsForward(dir)) - { n = OffsetNumberNext(n); - } else - { n = OffsetNumberPrev(n); - } b = ReadBuffer(s->relation, blk); p = BufferGetPage(b); @@ -190,13 +178,9 @@ rtnext(IndexScanDesc s, ScanDirection dir) po = (RTreePageOpaque) PageGetSpecialPointer(p); if (ScanDirectionIsBackward(dir)) - { n = OffsetNumberPrev(stk->rts_child); - } else - { n = OffsetNumberNext(stk->rts_child); - } so->s_stack = stk->rts_parent; pfree(stk); @@ -230,13 +214,9 @@ rtnext(IndexScanDesc s, ScanDirection dir) po = (RTreePageOpaque) PageGetSpecialPointer(p); if (ScanDirectionIsBackward(dir)) - { n = PageGetMaxOffsetNumber(p); - } else - { n = FirstOffsetNumber; - } } } } @@ -283,13 +263,9 @@ findnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir) } if (ScanDirectionIsBackward(dir)) - { n = OffsetNumberPrev(n); - } else - { n = OffsetNumberNext(n); - } } return (n); @@ -345,9 +321,7 @@ rtheapptr(Relation r, ItemPointer itemp) ReleaseBuffer(b); } else - { ItemPointerSetInvalid(ip); - } return (ip); } diff --git a/src/backend/access/rtree/rtree.c b/src/backend/access/rtree/rtree.c index 4968162f761..57217b050b3 100644 --- a/src/backend/access/rtree/rtree.c +++ b/src/backend/access/rtree/rtree.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.23 1998/02/26 04:30:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.24 1998/06/15 19:28:01 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -450,9 +450,7 @@ rttighten(Relation r, memmove(oldud, datum, VARSIZE(datum)); } else - { memmove(oldud, datum, att_size); - } WriteBuffer(b); /* @@ -467,9 +465,7 @@ rttighten(Relation r, pfree(tdatum); } else - { ReleaseBuffer(b); - } pfree(datum); } @@ -587,9 +583,7 @@ dosplit(Relation r, } if ((bufblock = BufferGetBlockNumber(buffer)) != P_ROOT) - { PageRestoreTempPage(left, p); - } WriteBuffer(leftbuf); WriteBuffer(rightbuf); @@ -842,13 +836,9 @@ picksplit(Relation r, /* okay, which page needs least enlargement? */ if (i == maxoff) - { item_1 = itup; - } else - { item_1 = (IndexTuple) PageGetItem(page, PageGetItemId(page, i)); - } datum_alpha = ((char *) item_1) + sizeof(IndexTupleData); union_dl = (char *) (*fmgr_faddr(&rtstate->unionFn)) (datum_l, datum_alpha); diff --git a/src/backend/access/rtree/rtscan.c b/src/backend/access/rtree/rtscan.c index 2d47500e982..672d0e2005f 100644 --- a/src/backend/access/rtree/rtscan.c +++ b/src/backend/access/rtree/rtscan.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.15 1998/01/07 21:02:11 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.16 1998/06/15 19:28:01 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -104,17 +104,11 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key) * Set flags. */ if (RelationGetNumberOfBlocks(s->relation) == 0) - { s->flags = ScanUnmarked; - } else if (fromEnd) - { s->flags = ScanUnmarked | ScanUncheckedPrevious; - } else - { s->flags = ScanUnmarked | ScanUncheckedNext; - } s->scanFromEnd = fromEnd; @@ -133,9 +127,7 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key) p->s_stack = p->s_markstk = (RTSTACK *) NULL; p->s_flags = 0x0; for (i = 0; i < s->numberOfKeys; i++) - { p->s_internalKey[i].sk_argument = s->keyData[i].sk_argument; - } } else { @@ -279,9 +271,7 @@ rtdropscan(IndexScanDesc s) for (l = RTScans; l != (RTScanList) NULL && l->rtsl_scan != s; l = l->rtsl_next) - { prev = l; - } if (l == (RTScanList) NULL) elog(ERROR, "rtree scan list corrupted -- cannot find 0x%lx", s); diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index a88bd514b9f..fb888640a99 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.19 1998/01/07 21:02:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.20 1998/06/15 19:28:02 momjian Exp $ * * NOTES * Transaction aborts can now occur two ways: @@ -1450,9 +1450,7 @@ IsTransactionBlock() if (s->blockState == TBLOCK_INPROGRESS || s->blockState == TBLOCK_ENDABORT) - { return (true); - } return (false); } |