aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Naylor <john.naylor@postgresql.org>2022-12-20 14:13:14 +0700
committerJohn Naylor <john.naylor@postgresql.org>2022-12-20 14:13:14 +0700
commit995a9fb14f6aa81ad8eedaf4e8dce1b3e51105c0 (patch)
tree998d1007faf4c14f05d35934d3fc01ab6ba1a033 /src
parentcca186348929cd75f23ef1b25922386bf38cf99c (diff)
downloadpostgresql-995a9fb14f6aa81ad8eedaf4e8dce1b3e51105c0.tar.gz
postgresql-995a9fb14f6aa81ad8eedaf4e8dce1b3e51105c0.zip
Move variable increment to the end of the loop
This is less error prone and matches the placement of other code in the file. Justin Pryzby Reviewed by Tom Lane Discussion: https://www.postgresql.org/message-id/20221123172436.GJ11463@telsasoft.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/activity/backend_status.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/utils/activity/backend_status.c b/src/backend/utils/activity/backend_status.c
index 7ecf467b8cd..cf5582caf25 100644
--- a/src/backend/utils/activity/backend_status.c
+++ b/src/backend/utils/activity/backend_status.c
@@ -842,7 +842,6 @@ pgstat_read_current_status(void)
CHECK_FOR_INTERRUPTS();
}
- beentry++;
/* Only valid entries get included into the local array */
if (localentry->backendStatus.st_procpid > 0)
{
@@ -871,6 +870,8 @@ pgstat_read_current_status(void)
#endif
localNumBackends++;
}
+
+ beentry++;
}
/* Set the pointer only after completion of a valid table */