diff --git a/src/bgw/job.c b/src/bgw/job.c index 62a50cade..ee890a05e 100644 --- a/src/bgw/job.c +++ b/src/bgw/job.c @@ -45,12 +45,9 @@ GetLockConflictsCompat(const LOCKTAG *locktag, LOCKMODE lockmode, int *countp) VirtualTransactionId *ids = GetLockConflicts(locktag, lockmode); if (countp != NULL) { - VirtualTransactionId *i = ids; - *countp = 0; - while (VirtualTransactionIdIsValid(*i)) + for (*countp = 0; VirtualTransactionIdIsValid(ids[*countp]); (*countp)++) { - i += 1; - *countp += 1; + /* Counts the number of virtual transactions ids into countp */ } } return ids;