summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-10 16:05:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-10 16:05:23 (GMT)
commit3270d9e488f05802e717a37c96ebe76359395edb (patch)
treec1eaa94f35cdd45c5bf95e6f58094cce59832e4d /src/H5Shyper.c
parent5c361b59681087b8f0208525cc9a0fe9809690e4 (diff)
downloadhdf5-3270d9e488f05802e717a37c96ebe76359395edb.zip
hdf5-3270d9e488f05802e717a37c96ebe76359395edb.tar.gz
hdf5-3270d9e488f05802e717a37c96ebe76359395edb.tar.bz2
[svn-r8338] Purpose:
Code optimization Description: Avoid another extraneous dataspace copy. Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.9 (sleipnir) w/parallel too minor to require h5committest
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 1ecdd2a..55675c9 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -4120,19 +4120,23 @@ H5S_hyper_normalize_offset(H5S_t *space)
assert(space);
- /* Check if there is an offset currently */
- if(space->select.offset) {
- /* Invert the selection offset */
- for(u=0; u<space->extent.u.simple.rank; u++)
- space->select.offset[u] =- space->select.offset[u];
-
- /* Call the existing 'adjust' routine */
- if(H5S_hyper_adjust(space, space->select.offset)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization");
-
- /* Zero out the selection offset */
- for(u=0; u<space->extent.u.simple.rank; u++)
- space->select.offset[u] = 0;
+ /* Check for 'all' selection, instead of a hyperslab selection */
+ /* (Technically, this check shouldn't be in the "hyperslab" routines...) */
+ if(space->select.type!=H5S_SEL_ALL) {
+ /* Check if there is an offset currently */
+ if(space->select.offset) {
+ /* Invert the selection offset */
+ for(u=0; u<space->extent.u.simple.rank; u++)
+ space->select.offset[u] =- space->select.offset[u];
+
+ /* Call the existing 'adjust' routine */
+ if(H5S_hyper_adjust(space, space->select.offset)<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization");
+
+ /* Zero out the selection offset */
+ for(u=0; u<space->extent.u.simple.rank; u++)
+ space->select.offset[u] = 0;
+ } /* end if */
} /* end if */
done: