]> granicus.if.org Git - postgresql/commitdiff
Nest macros with slightly less enthusiasm, for performance and to avoid
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Jun 2001 05:00:56 +0000 (05:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Jun 2001 05:00:56 +0000 (05:00 +0000)
having non-gcc compilers spit up.

src/backend/access/gist/gist.c

index 8f0cfbbb499f575b642580d18ae5fb02c4867554..9d6e2040f6c3cd66caa8e060d7fe1db24dcf4e83 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.78 2001/05/31 18:16:54 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.79 2001/06/11 05:00:56 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1370,8 +1370,10 @@ gistchoose(Relation r, Page p, IndexTuple it,    /* it has compressed entry */
        for (i = FirstOffsetNumber; i <= maxoff && sum_grow; i = OffsetNumberNext(i))
        {
                sum_grow=0;
-               for( j=0; j<r->rd_att->natts; j++ ) {
-                       datum = index_getattr( (IndexTuple)PageGetItem(p, PageGetItemId(p, i)), j+1, r->rd_att, &IsNull);
+               for (j=0; j<r->rd_att->natts; j++) {
+                       IndexTuple itup = (IndexTuple) PageGetItem(p, PageGetItemId(p, i));
+
+                       datum = index_getattr(itup, j+1, r->rd_att, &IsNull);
                        gistdentryinit(giststate, j, &entry, datum, r, p, i, ATTSIZE( datum, r, j+1, IsNull ), FALSE);
                        FunctionCall3(&giststate->penaltyFn[j],
                                                  PointerGetDatum(&entry),