git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bcf7a35)
Rewrite for-loop, because this is not the Obfuscated C Code Contest.
2003年1月11日 05:01:03 +0000 (05:01 +0000)
2003年1月11日 05:01:03 +0000 (05:01 +0000)
Manfred Koizar


diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c
index 83e0c3372289fb11ab9d78450dc01f20663e6413..fd10c2aa918d72c844e7eb2bf587a46991254d38 100644 (file)
--- a/src/backend/storage/page/bufpage.c
+++ b/src/backend/storage/page/bufpage.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.50 2002年09月04日 20:31:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.51 2003年01月11日 05:01:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -409,8 +409,7 @@ PageIndexTupleDelete(Page page, OffsetNumber offnum)
unsigned offset;
int nbytes;
int offidx;
- int nline,
- i;
+ int nline;
/*
* As with PageRepairFragmentation, paranoia seems justified.
@@ -479,11 +478,12 @@ PageIndexTupleDelete(Page page, OffsetNumber offnum)
*/
if (!PageIsEmpty(page))
{
+ int i;
nline--; /* there's one less than when we started */
- for (i = nline; --i >= 0;)
+ for (i = 1; i <= nline; i++)
{
- if (PageGetItemId(phdr, i + 1)->lp_off <= offset)
- PageGetItemId(phdr, i + 1)->lp_off += size;
+ if (PageGetItemId(phdr, i)->lp_off <= offset)
+ PageGetItemId(phdr, i)->lp_off += size;
}
}
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /