aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/commit_ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/commit_ts.c')
-rw-r--r--src/backend/access/transam/commit_ts.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.c
index 659109f8d4b..9419a5ca416 100644
--- a/src/backend/access/transam/commit_ts.c
+++ b/src/backend/access/transam/commit_ts.c
@@ -168,7 +168,9 @@ TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids,
* subxid not on the previous page as head. This way, we only have to
* lock/modify each SLRU page once.
*/
- for (i = 0, headxid = xid;;)
+ headxid = xid;
+ i = 0;
+ for (;;)
{
int pageno = TransactionIdToCTsPage(headxid);
int j;
@@ -184,7 +186,7 @@ TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids,
pageno);
/* if we wrote out all subxids, we're done. */
- if (j + 1 >= nsubxids)
+ if (j >= nsubxids)
break;
/*
@@ -192,7 +194,7 @@ TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids,
* just wrote.
*/
headxid = subxids[j];
- i += j - i + 1;
+ i = j + 1;
}
/* update the cached value in shared memory */