diff options
author | David Young <dyoung@hdfgroup.org> | 2020-03-30 18:44:44 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-03-30 18:44:44 (GMT) |
commit | d0b8accbc1fbc533d436ddcc4de1ccc7964d55d5 (patch) | |
tree | c5fd8ef6b465e2146db1a3bcdea12bd99b492769 /src/H5Fvfd_swmr.c | |
parent | c7af3df89019d754f06f20f04518dc445befa846 (diff) | |
download | hdf5-d0b8accbc1fbc533d436ddcc4de1ccc7964d55d5.zip hdf5-d0b8accbc1fbc533d436ddcc4de1ccc7964d55d5.tar.gz hdf5-d0b8accbc1fbc533d436ddcc4de1ccc7964d55d5.tar.bz2 |
Relax H5F_update_vfd_swmr_metadata_file() argument checking so that we can call
it with num_entries == 0 and a non-NULL `index`. Delete some code that isn't
necessary if `num_entries == 0 && index != NULL` is allowed. NFCI.
Diffstat (limited to 'src/H5Fvfd_swmr.c')
-rw-r--r-- | src/H5Fvfd_swmr.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c index fdd2e8a..b30c721 100644 --- a/src/H5Fvfd_swmr.c +++ b/src/H5Fvfd_swmr.c @@ -912,19 +912,10 @@ H5F_vfd_swmr_writer_end_of_tick(H5F_t *f) * Note that this operation will restore the index to * sorted order. */ - if (f->shared->mdf_idx_entries_used + idx_entries_added > 0) { - - if ( H5F_update_vfd_swmr_metadata_file(f, - f->shared->mdf_idx_entries_used + idx_entries_added, - f->shared->mdf_idx) < 0 ) - - HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, "can't update MD file") - } else { - - if ( H5F_update_vfd_swmr_metadata_file(f, 0, NULL) < 0 ) - - HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, "can't update MD file") - } + if (H5F_update_vfd_swmr_metadata_file(f, + f->shared->mdf_idx_entries_used + idx_entries_added, + f->shared->mdf_idx) < 0) + HGOTO_ERROR(H5E_FILE, H5E_SYSTEM, FAIL, "can't update MD file") /* at this point the metadata file index should be sorted -- update * f->shared->mdf_idx_entries_used. @@ -1681,8 +1672,7 @@ H5F__vfd_swmr_construct_write_md_idx(H5F_t *f, uint32_t num_entries, FUNC_ENTER_STATIC - HDassert((num_entries!= 0 && index != NULL) || - (num_entries == 0 && index == NULL)); + HDassert(num_entries == 0 || index != NULL); /* Allocate space for the buffer to hold the index */ if ( (image = HDmalloc(idx_size)) == NULL ) |