summaryrefslogtreecommitdiffstats
path: root/src/H5Tconv.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-26 04:33:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-26 04:33:34 (GMT)
commit881ba16bcab480daf7144c193eac356e532ac14c (patch)
treebcb02a7a67783ceff1ffbbb15e546dad6a3ed98d /src/H5Tconv.c
parent8b866d0e85adc5fcf9e19bffaea0b26d6c43ab68 (diff)
downloadhdf5-881ba16bcab480daf7144c193eac356e532ac14c.zip
hdf5-881ba16bcab480daf7144c193eac356e532ac14c.tar.gz
hdf5-881ba16bcab480daf7144c193eac356e532ac14c.tar.bz2
[svn-r8945] Purpose:
Code optimization Description: Eliminate duplicated call to H5T_detect_class() Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest
Diffstat (limited to 'src/H5Tconv.c')
-rw-r--r--src/H5Tconv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 8f3e77c..fd7693a 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -2230,6 +2230,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T_path_t *tpath; /* Type conversion path */
hbool_t noop_conv=FALSE; /* Flag to indicate a noop conversion */
hbool_t write_to_file=FALSE; /* Flag to indicate writing to file */
+ hbool_t parent_is_vlen; /* Flag to indicate parent is vlen datatyp */
hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
H5T_t *src = NULL; /*source data type */
H5T_t *dst = NULL; /*destination data type */
@@ -2318,7 +2319,8 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
noop_conv=TRUE;
/* Check if we need a temporary buffer for this conversion */
- if(tpath->cdata.need_bkg || H5T_detect_class(dst->parent,H5T_VLEN)) {
+ parent_is_vlen=H5T_detect_class(dst->parent,H5T_VLEN);
+ if(tpath->cdata.need_bkg || parent_is_vlen) {
/* Set up initial background buffer */
tmp_buf_size=MAX(src_base_size,dst_base_size);
if ((tmp_buf=H5FL_BLK_MALLOC(vlen_seq,tmp_buf_size))==NULL)
@@ -2334,7 +2336,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
write_to_file=TRUE;
/* Set the flag for nested VL case */
- if(write_to_file && H5T_detect_class(dst->parent,H5T_VLEN) && bkg!=NULL)
+ if(write_to_file && parent_is_vlen && bkg!=NULL)
nested=1;
/* The outer loop of the type conversion macro, controlling which */