1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-01-03 10:06:01 +01:00

remove redundant check of overwriting

This commit is contained in:
q-posev 2021-06-21 12:48:32 +02:00
parent 07d2945333
commit c8fd3ba045

View File

@ -233,14 +233,6 @@ trexio_hdf5_write_$group_num$ (trexio_t* const file, const uint64_t num)
trexio_exit_code rc = trexio_hdf5_read_$group_num$(file, &(infile_num)); trexio_exit_code rc = trexio_hdf5_read_$group_num$(file, &(infile_num));
if (rc != TREXIO_SUCCESS) return rc; if (rc != TREXIO_SUCCESS) return rc;
if (infile_num != num) {
if (infile_num != 0) {
return TREXIO_NUM_ALREADY_EXISTS;
} else {
const hid_t dtype = H5Tcopy(H5T_NATIVE_UINT64); const hid_t dtype = H5Tcopy(H5T_NATIVE_UINT64);
const hid_t num_id = H5Aopen(f->$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT); const hid_t num_id = H5Aopen(f->$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT);
if (num_id <= 0) return TREXIO_INVALID_ID; if (num_id <= 0) return TREXIO_INVALID_ID;
@ -250,8 +242,7 @@ trexio_hdf5_write_$group_num$ (trexio_t* const file, const uint64_t num)
H5Aclose(num_id); H5Aclose(num_id);
H5Tclose(dtype); H5Tclose(dtype);
}
}
return TREXIO_SUCCESS; return TREXIO_SUCCESS;
} }