summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-03-20 22:13:48 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-03-20 22:13:48 (GMT)
commit4f8a844a00b476217b88aa00109fa0147c5b41e8 (patch)
tree2ba978bd407922c646cf9518723df6882d281021 /src/H5Shyper.c
parent962fb0ccb81e6d3b528d5bdcaba1d85b16b348c2 (diff)
downloadhdf5-4f8a844a00b476217b88aa00109fa0147c5b41e8.zip
hdf5-4f8a844a00b476217b88aa00109fa0147c5b41e8.tar.gz
hdf5-4f8a844a00b476217b88aa00109fa0147c5b41e8.tar.bz2
Clean up if-else chain.
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 17c3d65..60fcf5a 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -4877,37 +4877,35 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1,
/* Check for both spans being NULL */
if(span1 == NULL && span2 == NULL)
HGOTO_DONE(TRUE)
- else {
- /* Check for one span being NULL */
- if(span1 == NULL || span2 == NULL)
- HGOTO_DONE(FALSE)
+
+ /* Check for one span being NULL */
+ if(span1 == NULL || span2 == NULL)
+ HGOTO_DONE(FALSE)
+
+ /* Check if the actual low & high span information is the same */
+ if((hsize_t)((hssize_t)span1->low + offset[0]) != span2->low || (hsize_t)((hssize_t)span1->high + offset[0]) != span2->high)
+ HGOTO_DONE(FALSE)
+
+ /* Check for down tree for this span */
+ if(span1->down != NULL || span2->down != NULL) {
+ /* If the rest of the span trees have a zero offset, use the faster comparison routine */
+ if(rest_zeros[0]) {
+ if(!H5S__hyper_cmp_spans(span1->down, span2->down))
+ HGOTO_DONE(FALSE)
+ else {
+ /* Keep going... */
+ } /* end else */
+ } /* end if */
else {
- /* Check if the actual low & high span information is the same */
- if((hsize_t)((hssize_t)span1->low + offset[0]) != span2->low || (hsize_t)((hssize_t)span1->high + offset[0]) != span2->high)
+ if(!H5S__hyper_spans_shape_same_helper(span1->down, span2->down, &offset[1], &rest_zeros[1]))
HGOTO_DONE(FALSE)
else {
- if(span1->down != NULL || span2->down != NULL) {
- /* If the rest of the span trees have a zero offset, use the faster comparison routine */
- if(rest_zeros[0]) {
- if(!H5S__hyper_cmp_spans(span1->down, span2->down))
- HGOTO_DONE(FALSE)
- else {
- /* Keep going... */
- } /* end else */
- } /* end if */
- else {
- if(!H5S__hyper_spans_shape_same_helper(span1->down, span2->down, &offset[1], &rest_zeros[1]))
- HGOTO_DONE(FALSE)
- else {
- /* Keep going... */
- } /* end else */
- } /* end else */
- } /* end if */
- else {
- /* Keep going... */
- } /* end else */
+ /* Keep going... */
} /* end else */
} /* end else */
+ } /* end if */
+ else {
+ /* Keep going... */
} /* end else */
/* Advance to the next nodes in the span list */