summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-01-10 17:45:47 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-01-10 18:00:22 (GMT)
commitc4e19fa84bf3d9f0e621923b2b1fbf512c85b0b3 (patch)
tree6ac499ade890309550861485a4ae7721648434fd
parentd288a7b93c991297faece77af28dd5ff7648a875 (diff)
downloadhdf5-c4e19fa84bf3d9f0e621923b2b1fbf512c85b0b3.zip
hdf5-c4e19fa84bf3d9f0e621923b2b1fbf512c85b0b3.tar.gz
hdf5-c4e19fa84bf3d9f0e621923b2b1fbf512c85b0b3.tar.bz2
After quick-sorting the index, go ahead and assert that there are not
duplicate entries for the same HDF5 page offset. There's an O(n) cost to that, but it should be no more than the O(n log n) cost of the quicksort.
-rw-r--r--src/H5Fvfd_swmr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c
index ccee2d1..84cb736 100644
--- a/src/H5Fvfd_swmr.c
+++ b/src/H5Fvfd_swmr.c
@@ -441,14 +441,11 @@ H5F_update_vfd_swmr_metadata_file(H5F_t *f, uint32_t num_entries,
/* Sort index entries by increasing offset in the HDF5 file */
if (num_entries > 0) {
HDqsort(index, num_entries, sizeof(*index), H5F__idx_entry_cmp);
-#if 0
/* Assert that there are not any HDF5 page offsets duplicated in
* here.
*/
- for (i = 1; i < num_entries; i++) {
- assert(index[i].hdf5_page_offset != index[i - 1].hdf5_page_offset);
- }
-#endif
+ for (i = 1; i < num_entries; i++)
+ assert(index[i - 1].hdf5_page_offset < index[i].hdf5_page_offset);
}
/* For each non-null entry_ptr in the index: