summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-06-08 16:06:06 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2020-06-08 16:06:06 (GMT)
commitab3721a7709665942c5d4066aa2de9c2da36ab3f (patch)
tree2e4ad82093b9322b9297d8fec2cd11d012c0d11b /src
parent1030a7ac9a2a77e03f6fc496ccc88b8bceae203a (diff)
parentb0f921c53fe4aa60bc0ed0fa10942da11ac4a3cd (diff)
downloadhdf5-ab3721a7709665942c5d4066aa2de9c2da36ab3f.zip
hdf5-ab3721a7709665942c5d4066aa2de9c2da36ab3f.tar.gz
hdf5-ab3721a7709665942c5d4066aa2de9c2da36ab3f.tar.bz2
Merge pull request #2628 in HDFFV/hdf5 from hdf5_1_12_tiny_shape_same_opt to hdf5_1_12
* commit 'b0f921c53fe4aa60bc0ed0fa10942da11ac4a3cd': Add info about optimization to release notes Detect when there's the same-shaped selection of a single block of elements on both selections, but with different selection types (i.e. one selection defined as an 'all' type and the other as a hyperslab or point type), without falling into the generic selection iteration case.
Diffstat (limited to 'src')
-rw-r--r--src/H5Sselect.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index e433dc1..47909f5 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -1885,6 +1885,15 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
space_a_dim--;
} /* end while */
+
+ /* Check for a single block in each selection */
+ if(H5S_SELECT_IS_SINGLE(space_a) && H5S_SELECT_IS_SINGLE(space_b)) {
+ /* If both selections are a single block and their bounds are
+ * the same, then the selections are the same, even if the
+ * selection types are different.
+ */
+ HGOTO_DONE(TRUE)
+ } /* end if */
} /* end if */
/* If the dataspaces have the same selection type, use the selection's