ECC-707: optimisation. Make one call per handle (not for every key)

This commit is contained in:
Shahram Najm 2019-07-26 13:12:59 +01:00
parent 3d3227a086
commit d9879974bb
1 changed files with 3 additions and 2 deletions

View File

@ -884,9 +884,12 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h)
int written_to_dump = 0; /* boolean */
grib_accessor* acc = NULL;
size_t num_vals = 0;
int fix_lsdate = 0;
if (!options->verbose) return;
fix_lsdate = (fix_for_lsdate_needed(h) && options->name_space && strcmp(options->name_space,"ls")==0);
for (i=0;i<options->print_keys_count;i++) {
size_t len=MAX_STRING_LEN;
ret=GRIB_SUCCESS;
@ -924,8 +927,6 @@ void grib_print_key_values(grib_runtime_options* options, grib_handle* h)
}
} else {
/* Other products e.g. GRIB */
const int fix_lsdate = (fix_for_lsdate_needed(h) && options->name_space && strcmp(options->name_space,"ls")==0);
if (grib_is_missing(h,options->print_keys[i].name,&ret) && ret==GRIB_SUCCESS) {
sprintf(value,"MISSING");
}