|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.9 1996/11/13 20:47:20 scrappy Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.10 1996/11/21 06:10:55 vadim Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -535,7 +535,6 @@ _bt_next(IndexScanDesc scan, ScanDirection dir)
|
535 | 535 | RetrieveIndexResult res;
|
536 | 536 | BlockNumber blkno;
|
537 | 537 | ItemPointer current;
|
538 |
| - ItemPointer iptr; |
539 | 538 | BTItem btitem;
|
540 | 539 | IndexTuple itup;
|
541 | 540 | BTScanOpaque so;
|
@@ -569,10 +568,7 @@ _bt_next(IndexScanDesc scan, ScanDirection dir)
|
569 | 568 | itup = &btitem->bti_itup;
|
570 | 569 |
|
571 | 570 | if (_bt_checkqual(scan, itup)) {
|
572 |
| - iptr = (ItemPointer) palloc(sizeof(ItemPointerData)); |
573 |
| - memmove((char *) iptr, (char *) &(itup->t_tid), |
574 |
| - sizeof(ItemPointerData)); |
575 |
| - res = FormRetrieveIndexResult(current, iptr); |
| 571 | + res = FormRetrieveIndexResult(current, &(itup->t_tid)); |
576 | 572 |
|
577 | 573 | /* remember which buffer we have pinned and locked */
|
578 | 574 | so->btso_curbuf = buf;
|
@@ -608,7 +604,6 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
608 | 604 | BTItem btitem;
|
609 | 605 | IndexTuple itup;
|
610 | 606 | ItemPointer current;
|
611 |
| - ItemPointer iptr; |
612 | 607 | BlockNumber blkno;
|
613 | 608 | StrategyNumber strat;
|
614 | 609 | RetrieveIndexResult res;
|
@@ -764,11 +759,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
764 | 759 | itup = &btitem->bti_itup;
|
765 | 760 |
|
766 | 761 | if (_bt_checkqual(scan, itup)) {
|
767 |
| - iptr = (ItemPointer) palloc(sizeof(ItemPointerData)); |
768 |
| - memmove((char *) iptr, (char *) &(itup->t_tid), |
769 |
| - sizeof(ItemPointerData)); |
770 |
| - res = FormRetrieveIndexResult(current, iptr); |
771 |
| - pfree(iptr); |
| 762 | + res = FormRetrieveIndexResult(current, &(itup->t_tid)); |
772 | 763 |
|
773 | 764 | /* remember which buffer we have pinned */
|
774 | 765 | so->btso_curbuf = buf;
|
@@ -1035,7 +1026,6 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
1035 | 1026 | Page page;
|
1036 | 1027 | BTPageOpaque opaque;
|
1037 | 1028 | ItemPointer current;
|
1038 |
| - ItemPointer iptr; |
1039 | 1029 | OffsetNumber offnum, maxoff;
|
1040 | 1030 | OffsetNumber start = 0;
|
1041 | 1031 | BlockNumber blkno;
|
@@ -1132,10 +1122,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
1132 | 1122 |
|
1133 | 1123 | /* see if we picked a winner */
|
1134 | 1124 | if (_bt_checkqual(scan, itup)) {
|
1135 |
| - iptr = (ItemPointer) palloc(sizeof(ItemPointerData)); |
1136 |
| - memmove((char *) iptr, (char *) &(itup->t_tid), |
1137 |
| - sizeof(ItemPointerData)); |
1138 |
| - res = FormRetrieveIndexResult(current, iptr); |
| 1125 | + res = FormRetrieveIndexResult(current, &(itup->t_tid)); |
1139 | 1126 |
|
1140 | 1127 | /* remember which buffer we have pinned */
|
1141 | 1128 | so = (BTScanOpaque) scan->opaque;
|
|
0 commit comments