Skip to content

Commit

Permalink
bpls: Simplify variable and attribute count lookup
Browse files Browse the repository at this point in the history
Use `GetVariables` and `GetAttributes` directly to avoid constructing a
whole variable or attribute map just to get its size.
  • Loading branch information
bradking committed Jul 6, 2020
1 parent e5ad0f5 commit ed44050
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions source/utils/bpls/bpls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,13 +1474,9 @@ int doList(const char *path)
// ntsteps = fp->tidx_stop - fp->tidx_start + 1;
if (verbose)
{
const std::map<std::string, Params> &variablesInfo =
io.GetAvailableVariables();
const std::map<std::string, Params> &attributesInfo =
io.GetAvailableAttributes();
printf("File info:\n");
printf(" of variables: %zu\n", variablesInfo.size());
printf(" of attributes: %zu\n", attributesInfo.size());
printf(" of variables: %zu\n", io.GetVariables().size());
printf(" of attributes: %zu\n", io.GetAttributes().size());
// printf(" of meshes: %d\n", fp->nmeshes);
// print_file_size(fp->file_size);
// printf(" bp version: %d\n", fp->version);
Expand Down

0 comments on commit ed44050

Please sign in to comment.