From 881ba16bcab480daf7144c193eac356e532ac14c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 25 Jul 2004 23:33:34 -0500 Subject: [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 --- src/H5Tconv.c | 6 ++++-- 1 file 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 */ -- cgit v0.12