PG-289: Remove ‘for’ loop initial declarations. (#256)

pull/259/head
Ibrar Ahmed 2022-06-09 16:13:43 +05:00 committed by GitHub
parent 4f056813e0
commit 1b89fa1814
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -1664,12 +1664,16 @@ pg_stat_monitor_reset(PG_FUNCTION_ARGS)
*(uint64 *)pgss_qbuf = 0;
#ifdef BENCHMARK
for (int i = STATS_START; i < STATS_END; ++i) {
{
int i;
for (i = STATS_START; i < STATS_END; ++i)
{
pg_hook_stats[i].min_time = 0;
pg_hook_stats[i].max_time = 0;
pg_hook_stats[i].total_time = 0;
pg_hook_stats[i].ncalls = 0;
}
}
#endif
LWLockRelease(pgss->lock);
PG_RETURN_VOID();
@ -3399,8 +3403,9 @@ pg_stat_monitor_settings(PG_FUNCTION_ARGS)
if (conf->type == PGC_ENUM)
{
size_t i;
strcat(options, conf->guc_options[0]);
for (size_t i = 1; i < conf->n_options; ++i)
for (i = 1; i < conf->n_options; ++i)
{
strcat(options, ", ");
strcat(options, conf->guc_options[i]);