diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:33:31 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:33:31 (GMT) |
commit | 6543e55efad7ded7f5a0e0dc50786c966aea6b98 (patch) | |
tree | 35644557ee9e67b47a30ca284fb1522f108b8959 /src/H5Tconv.c | |
parent | 5ffd704c8ce8a0f1d0f0b85fc3dcfa58779002b7 (diff) | |
download | hdf5-6543e55efad7ded7f5a0e0dc50786c966aea6b98.zip hdf5-6543e55efad7ded7f5a0e0dc50786c966aea6b98.tar.gz hdf5-6543e55efad7ded7f5a0e0dc50786c966aea6b98.tar.bz2 |
[svn-r8944] 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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 698c99f..a419577 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -2428,6 +2428,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 */ @@ -2516,7 +2517,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) @@ -2532,7 +2534,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 */ |