summaryrefslogtreecommitdiffstats
path: root/src/H5Sselect.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2019-06-01 00:26:56 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2019-06-01 00:26:56 (GMT)
commit35a8a549f6714533b100ca1512979165c0a0f359 (patch)
tree81c285d0e6c8ab11149a29a8fbe99329e0a5693d /src/H5Sselect.c
parent4af633d1c480deb7d27c1da7ee2c512a2500e543 (diff)
downloadhdf5-35a8a549f6714533b100ca1512979165c0a0f359.zip
hdf5-35a8a549f6714533b100ca1512979165c0a0f359.tar.gz
hdf5-35a8a549f6714533b100ca1512979165c0a0f359.tar.bz2
Refactor H5S__hyper_project_intersection to operate directly on span
trees, improving performance and removing the conditionn that the extents be equal.
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r--src/H5Sselect.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 80b5ea1..6983c93 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -2374,10 +2374,11 @@ H5S_select_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
if(H5S_select_copy(new_space, dst_space, FALSE) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy destination space selection")
} /* end if */
- /* If any of the spaces are "none", the projection must also be "none" */
- else if((src_intersect_space->select.type->type == H5S_SEL_NONE)
- || (src_space->select.type->type == H5S_SEL_NONE)
- || (dst_space->select.type->type == H5S_SEL_NONE)) {
+ /* If any of the selections contain no elements, the projection must be
+ * "none" */
+ else if((H5S_GET_SELECT_NPOINTS(src_intersect_space) == 0)
+ || (H5S_GET_SELECT_NPOINTS(src_space) == 0)
+ || (H5S_GET_SELECT_NPOINTS(dst_space) == 0)) {
/* Change to "none" selection */
if(H5S_select_none(new_space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
@@ -2389,6 +2390,8 @@ H5S_select_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "point selections not currently supported")
else {
HDassert(src_intersect_space->select.type->type == H5S_SEL_HYPERSLABS);
+ HDassert(src_space->select.type->type != H5S_SEL_NONE);
+ HDassert(dst_space->select.type->type != H5S_SEL_NONE);
/* Intersecting space is hyperslab selection. Call the hyperslab
* routine to project to another hyperslab selection. */