Skip to content

Commit 995a9fb

Browse files
committed
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
1 parent cca1863 commit 995a9fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/utils/activity/backend_status.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,6 @@ pgstat_read_current_status(void)
842842
CHECK_FOR_INTERRUPTS();
843843
}
844844

845-
beentry++;
846845
/* Only valid entries get included into the local array */
847846
if (localentry->backendStatus.st_procpid > 0)
848847
{
@@ -871,6 +870,8 @@ pgstat_read_current_status(void)
871870
#endif
872871
localNumBackends++;
873872
}
873+
874+
beentry++;
874875
}
875876

876877
/* Set the pointer only after completion of a valid table */

0 commit comments

Comments
 (0)