Skip to content

Commit

Permalink
remove the duplicated H5Pget_filter_by_id
Browse files Browse the repository at this point in the history
  • Loading branch information
disheng222 committed Aug 20, 2022
1 parent 8e7f2bd commit 32bf2db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hdf5-filter/H5Z-SZ/src/H5Z_SZ.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,14 @@ static herr_t H5Z_sz_set_local(hid_t dcpl_id, hid_t type_id, hid_t chunk_space_i
unsigned int mem_cd_values[12]={0,0,0,0,0,0,0,0,0,0,0,0};

//H5Z_FILTER_SZ
//note that mem_cd_nelmts must be non-zero, otherwise, mem_cd_values cannot be filled.
if (0 > H5Pget_filter_by_id(dcpl_id, H5Z_FILTER_SZ, &flags, &mem_cd_nelmts, mem_cd_values, 0, NULL, NULL))
H5Z_SZ_PUSH_AND_GOTO(H5E_PLINE, H5E_CANTGET, 0, "unable to get current SZ cd_values");

//the duplicated H5Pget_filter_by_id() is not a careless mistake....
//The first H5Pget_filter_by_id() is to get the number of cd_values, and the second one is to fill the cd_values.
if (0 > H5Pget_filter_by_id(dcpl_id, H5Z_FILTER_SZ, &flags, &mem_cd_nelmts, mem_cd_values, 0, NULL, NULL))
H5Z_SZ_PUSH_AND_GOTO(H5E_PLINE, H5E_CANTGET, 0, "unable to get current SZ cd_values");
//if (0 > H5Pget_filter_by_id(dcpl_id, H5Z_FILTER_SZ, &flags, &mem_cd_nelmts, mem_cd_values, 0, NULL, NULL))
// H5Z_SZ_PUSH_AND_GOTO(H5E_PLINE, H5E_CANTGET, 0, "unable to get current SZ cd_values");

//printf("22mem_cd_nelmts=%zu\n", mem_cd_nelmts);
//for(int i=0;i<mem_cd_nelmts;i++)
Expand Down

0 comments on commit 32bf2db

Please sign in to comment.