diff options
Diffstat (limited to 'src/backend/optimizer')
| -rw-r--r-- | src/backend/optimizer/path/costsize.c | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index 1e94c5aa7c4..75acea149c7 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -2447,7 +2447,6 @@ append_nonpartial_cost(List *subpaths, int numpaths, int parallel_workers)  	int			arrlen;  	ListCell   *l;  	ListCell   *cell; -	int			i;  	int			path_index;  	int			min_index;  	int			max_index; @@ -2486,7 +2485,6 @@ append_nonpartial_cost(List *subpaths, int numpaths, int parallel_workers)  	for_each_cell(l, subpaths, cell)  	{  		Path	   *subpath = (Path *) lfirst(l); -		int			i;  		/* Consider only the non-partial paths */  		if (path_index++ == numpaths) @@ -2495,7 +2493,8 @@ append_nonpartial_cost(List *subpaths, int numpaths, int parallel_workers)  		costarr[min_index] += subpath->total_cost;  		/* Update the new min cost array index */ -		for (min_index = i = 0; i < arrlen; i++) +		min_index = 0; +		for (int i = 0; i < arrlen; i++)  		{  			if (costarr[i] < costarr[min_index])  				min_index = i; @@ -2503,7 +2502,8 @@ append_nonpartial_cost(List *subpaths, int numpaths, int parallel_workers)  	}  	/* Return the highest cost from the array */ -	for (max_index = i = 0; i < arrlen; i++) +	max_index = 0; +	for (int i = 0; i < arrlen; i++)  	{  		if (costarr[i] > costarr[max_index])  			max_index = i; | 
