diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-10 16:04:53 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-04-10 16:04:53 (GMT) |
commit | 4f7308af91e3364e6ca81b242cb5717aceb4a37f (patch) | |
tree | 09e137c85965259b13a37f16646baaf850502b45 /src/H5Shyper.c | |
parent | eb7a675f0a1bb565bdeb4c97697c9821c5ce72cc (diff) | |
download | hdf5-4f7308af91e3364e6ca81b242cb5717aceb4a37f.zip hdf5-4f7308af91e3364e6ca81b242cb5717aceb4a37f.tar.gz hdf5-4f7308af91e3364e6ca81b242cb5717aceb4a37f.tar.bz2 |
[svn-r8337] 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.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 6a6d604..176959f 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -4122,19 +4122,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: |