Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef581f0

Browse files
committed
Rewrite for-loop, because this is not the Obfuscated C Code Contest.
Manfred Koizar
1 parentbcf7a35 commitef581f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎src/backend/storage/page/bufpage.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.50 2002/09/04 20:31:26 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.51 2003/01/11 05:01:03 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -409,8 +409,7 @@ PageIndexTupleDelete(Page page, OffsetNumber offnum)
409409
unsignedoffset;
410410
intnbytes;
411411
intoffidx;
412-
intnline,
413-
i;
412+
intnline;
414413

415414
/*
416415
* As with PageRepairFragmentation, paranoia seems justified.
@@ -479,11 +478,12 @@ PageIndexTupleDelete(Page page, OffsetNumber offnum)
479478
*/
480479
if (!PageIsEmpty(page))
481480
{
481+
inti;
482482
nline--;/* there's one less than when we started */
483-
for (i=nline;--i >=0;)
483+
for (i=1;i <=nline;i++)
484484
{
485-
if (PageGetItemId(phdr,i+1)->lp_off <=offset)
486-
PageGetItemId(phdr,i+1)->lp_off+=size;
485+
if (PageGetItemId(phdr,i)->lp_off <=offset)
486+
PageGetItemId(phdr,i)->lp_off+=size;
487487
}
488488
}
489489
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp