Skip to content

Commit

Permalink
Per #2883, move initialization inside the same loop to resolve SonarQ…
Browse files Browse the repository at this point in the history
…ube issues.
  • Loading branch information
JohnHalleyGotway committed May 13, 2024
1 parent 9262654 commit a3bc1fa
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/tools/core/pcp_combine/pcp_combine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,19 +592,16 @@ void sum_data_files(Grid & grid, DataPlane & plane) {
<< sec_to_hhmmss(out_accum) << ".\n";

//
// Compute the valid times for the precipitation files
// to be found.
// Search for each file time.
//
for(i=0; i<n_files; i++) {
for(i=0, n_vld=0; i<n_files; i++) {

//
// Define the target valid time and initialize.
//
pcp_times[i] = valid_time - i*in_accum;
pcp_recs[i] = -1;
pcp_files[i] = "";
}

//
// Search for each file time.
//
for(i=0, n_vld=0; i<n_files; i++) {

//
// Search in each directory for the current file time.
Expand Down

0 comments on commit a3bc1fa

Please sign in to comment.